软件著作权申请源程序

**汽车商城管理系统源程序

using System;

using System.Collections.Generic;

using System.Text;

namespace Qing.Model

{

///

/// 购物车实体类

///

[Serializable]

public partial class cart_keys

{

public cart_keys() { }

#region Model

private int _article_id;

private int _quantity = 0;

///

/// 文章ID

///

public int article_id

{

set { _article_id = value; }

get { return _article_id; }

}

///

/// 购买数量

///

public int quantity

{

set { _quantity = value; }

get { return _quantity; }

}

#endregion

}

///

/// 购物车列表

///

[Serializable]

public partial class cart_items

{

public cart_items(){ }

#region Model

private int _article_id;

private string _goods_no = string.Empty;

private string _title = string.Empty;

private string _spec_text = string.Empty; private string _img_url = string.Empty;

private decimal _sell_price = 0M;

private decimal _user_price = 0M;

private int _quantity = 1;

private int _stock_quantity = 0;

///

/// 文章ID

///

public int id

{

set { _article_id = value; }

get { return _article_id; }

}

///

/// 商品货号

///

public string goods_no

{

set { _goods_no = value; }

get { return _goods_no; }

}

///

/// 商品名称

///

public string title

{

set { _title = value; }

get { return _title; }

}

///

/// 商品地址

///

public string linkurl { get; set; } ///

/// 商品规格

///

public string spec_text

{

set { _spec_text = value; }

get { return _spec_text; }

}

///

/// 图片路径

///

public string img_url

{

set { _img_url = value; }

get { return _img_url; }

}

///

/// 销售单价

///

public decimal sell_price

{

set { _sell_price = value; }

get { return _sell_price; }

}

///

/// 会员单价

///

public decimal user_price

{

set { _user_price = value; }

get { return _user_price; }

}

///

/// 购买数量

///

public int quantity

{

get { return _quantity; }

set { _quantity = value; }

}

///

/// 库存数量

///

public int stock_quantity

{

set { _stock_quantity = value; } get { return _stock_quantity; } }

#endregion

}

///

/// 购物车统计

///

[Serializable]

public partial class cart_total

{

public cart_total()

{ }

#region Model

private int _total_num = 0;

private int _total_quantity = 0;

private decimal _payable_amount = 0M; private decimal _real_amount = 0M;

private int _total_point = 0;

///

/// 商品种数

///

public int total_num

{

set { _total_num = value; }

get { return _total_num; }

}

///

/// 商品总数量

///

public int total_quantity

{

set { _total_quantity = value; } get { return _total_quantity; } }

///

/// 应付商品总金额

///

public decimal payable_amount

{

set { _payable_amount = value; } get { return _payable_amount; } }

///

/// 实付商品总金额

///

public decimal real_amount

{

set { _real_amount = value; }

get { return _real_amount; }

}

#endregion

}

}

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace Qing.Model

{

[Serializable]

[Table(Name = "contents")]

public class Earticles

{

public Earticles()

{

addtime = DateTime.Now;

islock = 0;

taxis = DateTime.Now.Ticks / 100000;

}

[Id(Name = "id", Strategy = GenerationType.INDENTITY)]

public int id{ get; set; }

public int nodeid{ get; set; }

[Column(IsInsert = false, IsUpdate = false)]

public string nodename { get; set; }

[Column(IsInsert = false, IsUpdate = false)]

public int dep_id { get; set; }

[Column(IsUpdate = false)]

public string adduser{ get; set; }

public DateTime addtime{ get; set; }

public string lastuser{ get; set; }

[Column(IsInsert = false)]

public DateTime lasttime { get; set; }

public long taxis{ get; set; }

public string title{ get; set; }

public string subtitle{ get; set; }

public string imgurl{ get; set; }

public string linkurl{ get; set; }

public int istj{ get; set; }

public int istop{ get; set; }

public int ispics{ get; set; }

public int ishot{ get; set; }

public int islock{ get; set; }

[Column(Ignore = true)]

public earticlelock eislock

{

get { return (earticlelock)islock; }

set { islock = (int)value; }

}

public string content{ get; set; }

public string author{ get; set; }

public string source{ get; set; }

public string seotitle{ get; set; }

public string seokeyword{ get; set; }

public string seodescr{ get; set; }

public int hit{ get; set; }

public string summary{ get; set; }

public string specialid{ get; set; }

public string etdxml{ get; set; } ///

/// 修改记录

///

public string remark { get; set; }

///

/// 购买数量

///

public int quantity { get; set; }

///

/// 市场价格

///

public decimal marketprice { get; set; }

///

/// 实际售价

///

public decimal price { get; set; }

///

/// 优惠截止时间

///

public string endtime { get; set; }

}

public enum earticlelock

{

审核退回=-2,

已删除 = -1,

待审核 = 0,

正常=1,

已批复=2

}

}

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace Qing.Model

{

[Serializable]

[Table(Name = "order_goods")]

public class Eorder_goods

{

[Id(Name = "id", Strategy = GenerationType.INDENTITY)]

public int id{ get; set; }

public int article_id{ get; set; }

public int order_id{ get; set; }

public string goods_no{ get; set; }

public string goods_title{ get; set; }

public string img_url{ get; set; }

public string linkurl { get; set; }

public string spec_text{ get; set; }

public Decimal goods_price{ get; set; }

public Decimal real_price{ get; set; }

public int quantity{ get; set; }

public int point{ get; set; }

}

}

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace Qing.Model

{

[Serializable]

[Table(Name = "orders")]

public class Eorders

{

[Id(Name = "id", Strategy = GenerationType.INDENTITY)]

public int id{ get; set; }

public string order_no{ get; set; }

public string trade_no{ get; set; }

public int user_id{ get; set; }

public string user_name{ get; set; }

public int payment_id{ get; set; }

[Column(IsInsert=false,IsUpdate=false)]

public string paytitle { get; set; }

public Decimal payment_fee{ get; set; }

[Column(Ignore = true)]

public epaystatus epay_status

{

get { return (epaystatus)payment_status; } set { payment_status = (int)value; }

}

public int payment_status{ get; set; }

public string payment_time{ get; set; }

public string express_title{ get; set; }

public string express_no{ get; set; }

public Decimal express_fee{ get; set; }

public int express_status{ get; set; }

public string express_time{ get; set; }

public string accept_name{ get; set; }

public string post_code{ get; set; }

public string telphone{ get; set; }

public string mobile{ get; set; }

public string email{ get; set; }

public string area{ get; set; }

public string address{ get; set; }

public string message{ get; set; }

public string remark{ get; set; }

public int is_invoice{ get; set; }

public string invoice_title{ get; set; }

public Decimal invoice_taxes{ get; set; }

public Decimal payable_amount{ get; set; }

public Decimal real_amount{ get; set; }

public Decimal order_amount{ get; set; }

public int point{ get; set; }

public int status{ get; set; }

[Column(IsInsert=false,IsUpdate=false)]

public DateTime add_time{ get; set; }

public string confirm_time{ get; set; }

public string complete_time{ get; set; } }

public enum epaystatus

{

线下付款 = 0,

待支付 = 1,

已支付

}

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace Qing.Model

{

[Serializable]

[Table(Name = "payment")]

public class Epayment

{

[Id(Name = "id", Strategy = GenerationType.INDENTITY)]

public int id{ get; set; }

public string title{ get; set; }

public string img_url{ get; set; }

public string remark{ get; set; }

public int type{ get; set; }

public string vesion { get; set; }

public int poundage_type{ get; set; }

public Decimal poundage_amount{ get; set; }

public int sort_id{ get; set; }

public int is_lock{ get; set; }

public string api_path{ get; set; }

///

/// 商户终端编码

///

public string terminalId { get; set; }

public string defaultpage { get; set; }

///

/// 合作身份者ID

///

public string partner { get; set; }

public string md5key { get; set; }

public string email { get; set; }

public int unicode { get; set; }

public string return_url { get; set; }

public string notice_url { get; set; }

}

}

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace Qing.Model

[Serializable]

[Table(Name = "bank")]

public class Ebank

{

[Id(Name = "id", Strategy = GenerationType.INDENTITY)]

public int id{ get; set; }

///

/// 简称

///

public string shortname { get; set; }

public int btype{ get; set; }

///

/// 银行名称

///

public string name{ get; set; }

public string icoimg{ get; set; }

///

/// 开户行

///

public string bankname{ get; set; }

///

/// 收款人

///

public string bankuser{ get; set; }

public string bankid{ get; set; }

public int taxis{ get; set; }

public string bz{ get; set; }

public string weburl{ get; set; }

}

}

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace Qing.Model

{

[Serializable]

[Table(Name = "view_article")]

public class EVarticle

{

[Id(Name = "id", Strategy = GenerationType.INDENTITY)]

public int id{ get; set; }

public int nodeid{ get; set; }

public string nodename { get; set; }

///

/// 内容是否开启图片组

///

public int istp { get; set; }

///

/// 内容是否开启附件上传

///

public int isfile { get; set; }

///

/// 是否开启评论

///

public int ispl { get; set; }

public string ishtml { get; set; }

[Column(IsUpdate = false)]

public string adduser{ get; set; }

public DateTime addtime{ get; set; }

public string lastuser{ get; set; }

[Column(IsInsert = false)]

public DateTime lasttime { get; set; } public long taxis{ get; set; }

public string title{ get; set; }

public string subtitle{ get; set; }

public string imgurl{ get; set; }

public string linkurl{ get; set; }

public int istj{ get; set; }

public int istop{ get; set; }

public int ispics{ get; set; }

public int ishot{ get; set; }

public int islock{ get; set; }

public string content{ get; set; }

public string author{ get; set; }

public string source{ get; set; }

public string seotitle{ get; set; }

public string seokeyword{ get; set; }

public string seodescr{ get; set; }

public int hit{ get; set; }

public string summary{ get; set; }

public string specialid{ get; set; }

public string etdxml{ get; set; }

public int quantity { get; set; }

public decimal marketprice { get; set; } public decimal price { get; set; }

public string endtime { get; set; }

}

}

using System;

using System.Linq;

using System.IO;

using https://www.360docs.net/doc/2010133909.html,;

using System.Text;

using System.Web.UI.WebControls;

using System.Collections;

using System.Collections.Generic;

using System.Data;

using System.Web;

using System.Web.SessionState;

using Qing.Site;

using https://www.360docs.net/doc/2010133909.html,mon;using Qing.Model;using Qing.DAL;

using Qing.DBUtility;

using Qing.Session;

namespace Qing.Web.tools

{

///

/// 管理后台AJAX处理页

///

public class admin_ajax : IHttpHandler, IRequiresSessionState

{

private ParamMap _pm = ParamMap.newMap();

protected Model.siteconfig siteConfig =

DAL.xml.loadConfig("~/skin/xmlconfig/site.config"); protected Model.Euserconfig uconfig =

DAL.xml.loadConfig("~/skin/xmlconfig/user.config"); public void ProcessRequest(HttpContext context)

{

//取得处事类型

string action = r.GetQueryString("action");

//判断管理员是否登录

if (!https://www.360docs.net/doc/2010133909.html,er.Identity.IsAuthenticated)

{

return;

}

switch (action)

{

case "get_nav_list":

get_nav_list(context);

break;

case "px":

px(context);

break;

case "attribute_field_validate": //验证扩展字段是否重复

attribute_field_validate(context);

break;

case "index_validate": //验证栏目索引是否重复

index_validate(context);

break;

case "etdxml": //验证扩展字段是否重复

etdxml(context);

break;

case "avatar":

user_avatar_crop(context);

break;

case "edit_order_status": //修改订单信息和状态

edit_order_status(context);

break;

case "downzip":

downzip(context);

break;

}

}

#region 获取后台导航字符串==============================

private void get_nav_list(HttpContext context)

{

Site.BasePage bp = new BasePage();

string querysql = " select * from navigation where islock=0 and classlayer<4 order by classlayer,pid,taxis,id";

string p0str = "

name=\"{0}\" >

    {1}
";

string p1str = "

  • {1}
      {2}
  • ";

    string str = "

  • class=\"item\">

    {1}
  • ";

    StringBuilder sb = new StringBuilder();

    List list = new DALty().GetListAll(querysql,"", false); foreach (Enavigation m1 in list.FindAll(i => i.classlayer == 1))

    {

    string str1 = string.Empty;

    foreach (Enavigation m2 in list.FindAll(i => i.classlayer == 2 && i.pid == m1.id)) {

    string str2 = string.Empty;

    foreach (Enavigation m in list.FindAll(i => i.classlayer == 3 && i.pid == m2.id)) {

    if(bp.HasPermission(m.roleattr))

    str2 += string.Format(str, m.linkurl, m.title);

    }

    if(str2!="")

    str1 += string.Format(p1str, m2.cssstyle, m2.title, str2);

    }

    if(str1!="")

    sb.Append(string.Format(p0str, m1.title, str1));

    }

    context.Response.Write(sb.ToString());

    }

    #endregion

    #region 排序==============================

    private void px(HttpContext context)

    {

    int id = r.GetFormInt("id");

    int type = r.GetFormInt("type");

    string table = r.GetFormString("table",true);

    long px = Convert.ToInt64(r.GetFormString("px"));

    long px2 = 0;

    int id2 = 0;

    if (id == 0 || string.IsNullOrEmpty(table))

    {

    context.Response.Write("{\"status\": 0, \"msg\": \"id错误\"}");

    return;

    }

    if (type == 0)

    {

    id2 = r.GetFormInt("pid");

    px2 = Convert.ToInt64(r.GetFormString("ppx")); }

    else

    {

    id2 = r.GetFormInt("nid");

    px2 = Convert.ToInt64(r.GetFormString("npx")); }

    if (px == px2)

    {

    px += 1;

    }

    _pm.setParameter("key_taxis", px2);

    _pm.setParameter("key_id", id);

    _pm.setParameter("key_taxis2", px);

    _pm.setParameter("key_id2", id2);

    new DALty().ExcuteSQL("update "+table+" set taxis=@key_taxis where

    id=@key_id;update "+table+" set taxis=@key_taxis2 where id=@key_id2",_pm);

    context.Response.Write("{\"status\": 1, \"msg\": \"ok\"}");

    return;

    }

    #endregion

    #region 验证扩展字段是否重复============================

    private void attribute_field_validate(HttpContext context)

    {

    string column_name = r.GetString("param");

    if (string.IsNullOrEmpty(column_name))

    {

    context.Response.Write("{ \"info\":\"名称不可为空\",

    \"status\":\"n\" }");

    return;

    }

    if (new DALty().exists("tablestyle",column_name,"name"))

    {

    context.Response.Write("{ \"info\":\"该名称已被占用,请更换!\", \"status\":\"n\" }");

    return;

    }

    context.Response.Write("{ \"info\":\"该名称可使用\",

    \"status\":\"y\" }");

    return;

    }

    #endregion

    #region 索引是否重复============================

    private void index_validate(HttpContext context)

    {

    string column_name = r.GetString("param");

    if (!string.IsNullOrEmpty(column_name))

    {

    if (new DALty().exists("nodes", column_name, "channelindex"))

    {

    context.Response.Write("{ \"info\":\"该名称重复,请更换!\", \"status\":\"n\" }");

    return;

    }

    context.Response.Write("{ \"info\":\"\", \"status\":\"y\" }"); }

    return;

    }

    #endregion

    #region 创建、赋值扩展字段============================

    private void etdxml(HttpContext context)

    {

    int id = r.GetQueryInt("id");

    int chid = r.GetQueryInt("chid");

    string table = r.GetQueryString("table");

    _pm.setParameter("tablename", table);

    List ls = new DALty().GetListAll("", _pm); if (ls.Count == 0) return;

    Hashtable hs = new Hashtable();

    if (id > 0)

    {

    Model.Earticles model = new DALty().GetModel(id.ToString()); if (model == null) return;

    if (!string.IsNullOrEmpty(model.etdxml))

    {

    string[] va = model.etdxml.Split('&');

    foreach (string s in va)

    {

    if (s == null) break;

    string[] v = s.Split('=');

    hs.Add(v[0], v[1]);

    }

    }

    }

    //读取自定义字段信息

    string tmpInfoBase = "

    {0}:
    {1}{2}
    \r\n";

    StringBuilder tmpInfo = new StringBuilder();

    string _html = string.Empty ;

    StringBuilder sbl = new StringBuilder();

    foreach (Etablestyle modelt in ls)

    {

    sbl.Clear();

    object _value = modelt.default_value;

    if (id > 0)

    _value = hs[https://www.360docs.net/doc/2010133909.html,];

    string _vld = "" +

    modelt.valid_tip_msg + "";

    switch (modelt.control_type)

    {

    case "single-text": //单行文本

    case "number": //数字

    case "multi-text":

    case "images": //图片上传

    case "editor": //编辑器

    case "date":

    _html = string.Format("

    tipmsg=\"{4}\" >", https://www.360docs.net/doc/2010133909.html,, _value, modelt.valid_pattern, modelt.valid_error_msg, modelt.valid_tip_msg);

    string css = string.Empty;

    if (modelt.control_type == "single-text") //单行

    {

    css = "input normal";

    }

    else if (modelt.control_type == "multi-text") //多行

    {

    _html = _html.Replace(" 0 ?

    hs[https://www.360docs.net/doc/2010133909.html,] : modelt.default_value) + "";

    _html = _html.Replace("*&*", "input\" rows=\"2\" cols=\"20\"\""); }

    else if (modelt.control_type == "editor") //编辑器

    {

    _html = _html.Replace("

    style=\"visibility:hidden;display: none;\"") + (id > 0 ? hs[https://www.360docs.net/doc/2010133909.html,] :

    modelt.default_value) + "";

    css = "editor";

    }

    else if (modelt.control_type == "number") //数字

    {

    css = "input small";

    }

    else if (modelt.control_type == "date") //日期

    {

    css = string.Format("input date\"

    onClick=WdatePicker({0}) \"", modelt.default_value == "" ? "" : "{dateFmt:\"" + modelt.default_value + "\"}");

    _html ="

    "+ _html + "日期
    "; }

    else if (modelt.control_type == "images") //图片

    {

    css = "input normal upload-path";

    _html += "

    upload-img\" style=\"margin-left:5px;\" value=\"上传图片\">";

    }

    _html = _html.Replace("*&*", css);

    break;

    case "checkbox": //复选框

    _html = string.Format("

    class=\"rule-single-checkbox\">

    ",

    https://www.360docs.net/doc/2010133909.html,, _value.ToString() == "on" ? "checked=checked" : ""); break;

    case "multi-radio": //多项单选

    sbl.Append(string.Format("

    class=\"rule-multi-radio\">", https://www.360docs.net/doc/2010133909.html,));

    string[] valArr = modelt.item_option.Split(new string[] { "\r\n", "\n" }, StringSplitOptions.None);

    for (int i = 0; i < valArr.Length; i++)

    {

    string[] valItemArr = valArr[i].Split('|');

    if (valItemArr.Length == 2)

    {

    sbl.Append(string.Format(" ",

    https://www.360docs.net/doc/2010133909.html,, i, valItemArr[1], _value.ToString() == valItemArr[1] ? "checked=checked" : "", valItemArr[0]));

    }

    }

    sbl.Append("

    ");

    _html = sbl.ToString();

    break;

    case "dropdownlist": //下拉列表

    sbl.Append(string.Format("

    class=\"rule-single-select\">

    ");

    _html = sbl.ToString();

    break;

    case "multi-checkbox": //多项多选

    sbl.Append(string.Format("

    class=\"rule-multi-checkbox\" >", https://www.360docs.net/doc/2010133909.html,));

    valArr = modelt.item_option.Split(new string[] { "\r\n", "\n" }, StringSplitOptions.None);

    _value = "," + _value + ",";

    for (int i = 0; i < valArr.Length; i++)

    {

    string[] valItemArr = valArr[i].Split('|');

    if (valItemArr.Length == 2)

    {

    sbl.Append(string.Format("

    name=\"{0}\" value=\"{1}\" {2} > ",

    https://www.360docs.net/doc/2010133909.html,, valItemArr[1], _value.ToString().IndexOf("," + valItemArr[1] + ",") > -1 ? "checked=checked" : "", valItemArr[0]));

    }

    }

    sbl.Append("");

    _html = sbl.ToString();

    break;

    }

    tmpInfo.Append(string.Format(tmpInfoBase, modelt.title, _html, _vld)); }

    context.Response.Write(tmpInfo.ToString());

    return;

    }

    #endregion

    #region 确认裁剪用户头像=============================

    private void user_avatar_crop(HttpContext context)

    {

    //检查用户是否登录

    Model.EVuser model = new BasePage().getEuser();

    string fileName = r.GetFormString("hideFileName");

    int x1 = r.GetFormInt("hideX1");

    int y1 = r.GetFormInt("hideY1");

    int w = r.GetFormInt("hideWidth");

    int h = r.GetFormInt("hideHeight");

    //检查是否图片

    //检查参数

    if (!u.FileExists(fileName) || w == 0 || h == 0)

    {

    context.Response.Write("{\"status\":0, \"msg\":\"对不起,请先上传一张图片!\"}"); return;

    }

    //取得保存的新文件名

    UpLoad upFiles = new UpLoad();

    bool result = upFiles.cropSaveAs(fileName, fileName, 180, 180, w, h, x1, y1); if (!result)

    {

    context.Response.Write("{\"status\": 0, \"msg\": \"图片裁剪过程中发生意外错误!\"}");

    return;

    }

    //删除原用户头像

    u.DeleteFile(model.avatar);

    new DALty().ExcuteSQL(string.Format("update users set avatar='{0}' where username='{1}'", fileName, https://www.360docs.net/doc/2010133909.html,ername));

    context.Session["user"] = null;

    context.Response.Write("{\"status\": 1, \"msg\": \"头像上传成功!\", \"avatar\": \"" + fileName + "\"}");

    return;

    }

    #endregion

    #region 修改订单信息和状态==============================

    private void edit_order_status(HttpContext context)

    {

    //取得订单配置信息

    Eorderconfig orderConfig =

    DAL.xml.loadConfig("~/skin/xmlconfig/order.config");

    BasePage bp = new BasePage();

    string order_no = r.GetString("order_no");

    string edit_type = r.GetString("edit_type");

    if (order_no == "")

    {

    context.Response.Write("{\"status\": 0, \"msg\": \"传输参数有误,无法获取订单号!\"}");

    return;

    }

    if (edit_type == "")

    {

    context.Response.Write("{\"status\": 0, \"msg\": \"无法获取修改订单类型!\"}");

    return;

    }

    Eorders model = new DALty().GetModel(order_no,"order_no");

    if (model == null)

    {

    context.Response.Write("{\"status\": 0, \"msg\": \"订单号不存在或已被删除!\"}");

    相关主题
    相关文档
    最新文档