Example #1
0
 public int Insert(M_Pro_Progress model)
 {
     if (model.OrderID == 0)
     {
         model.OrderID = GetMaxOrder(model.ProID);
     }
     return(Sql.insertID(TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Example #2
0
 //-----------------Insert
 /// <summary>
 /// 如有同名返回-1,否则返回被插入ID;
 /// </summary>
 public int Insert(M_IDC_DomPrice model)
 {
     if (CheckIsExist(model.DomName) != null)
     {
         return(-1);
     }
     return(Sql.insert(strTableName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Example #3
0
    public int AddContent(DataTable ContentDT, M_CommonData model)
    {
        int itemid = 0;

        if (!string.IsNullOrEmpty(model.TableName) && ContentDT.Rows.Count > 0)
        {
            string sql = InsertSql(ContentDT);
            if (!string.IsNullOrEmpty(sql))
            {
                string         strSql = "Insert Into " + model.TableName + sql + ";select @@IDENTITY AS newID";
                SqlParameter[] sp     = ContentPara(ContentDT);
                itemid = SqlHelper.ObjectToInt32(SqlHelper.ExecuteScalar(CommandType.Text, strSql, sp));
            }
        }
        string strSql3 = "select max(OrderID) from ZL_CommonModel";
        int    OrderID = SqlHelper.ObjectToInt32(SqlHelper.ExecuteScalar(CommandType.Text, strSql3, null)) + 1;

        model.ItemID  = itemid;
        model.OrderID = OrderID;
        //throw new Exception(model.ItemID.ToString() + ":" + itemid);
        // model.GetParameters()
        return(Sql.insertID("ZL_CommonModel", model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
    }
Example #4
0
        public bool Update(DataTable ContentDT, M_Product model)
        {
            int ItemID = model.ItemID;

            if (ContentDT != null && ContentDT.Rows.Count > 0)
            {
                if (string.IsNullOrEmpty(model.TableName))
                {
                    throw new Exception("商品附表为空");
                }
                List <SqlParameter> splist = new List <SqlParameter>();
                splist.AddRange(BLLCommon.GetParameters(ContentDT));
                if (DBCenter.IsExist(model.TableName, "ID=" + ItemID))
                {
                    DBCenter.UpdateSQL(model.TableName, BLLCommon.GetFieldAndPara(ContentDT), "ID=" + ItemID, splist);
                }
                else
                {
                    DBCenter.Insert(model.TableName, BLLCommon.GetFields(ContentDT), BLLCommon.GetParas(ContentDT), splist.ToArray());
                }
            }
            UpdateByID(model);
            return(true);
        }
Example #5
0
 public int GetInsert(M_Usermagazine model)
 {
     return(Sql.insert(strTableName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Example #6
0
 public int insert(M_Adzone model)
 {
     return(Sql.insertID(TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Example #7
0
 public int Insert(M_Order_Repair model)
 {
     return(Sql.insertID(TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Example #8
0
        public int Add(DataTable ContentDT, M_Product model)
        {
            //m_Product.ItemID = ItemID;
            int itemid = 0;

            if (!string.IsNullOrEmpty(model.TableName) && ContentDT.Rows.Count > 0)
            {
                itemid = DBCenter.Insert(model.TableName, BLLCommon.GetFields(ContentDT), BLLCommon.GetParas(ContentDT), BLLCommon.GetParameters(ContentDT).ToArray());
            }
            model.ItemID = itemid;
            return(Insert(model));
        }
Example #9
0
    protected void Button1_Click1(object sender, EventArgs e)
    {
        double     money = 5;
        M_UserInfo mu    = buser.GetLogin();
        DataTable  pubdt = SqlHelper.ExecuteTable(CommandType.Text, "select * from ZL_Pub_code where PubUserID=" + mu.UserID + " And Pubstart=1 And DATEDIFF(MINUTE,PubAddTime,GETDATE())<=5", null);

        if (pubdt.Rows.Count > 0)
        {
            function.WriteErrMsg("五分钟之内只能购买一次!");
        }
        else
        {
            DataTable bmdt = SqlHelper.ExecuteTable("select * from ZL_CommonModel left join ZL_C_yjbl on ItemID=ID where ModelID=51 And Status=99 And bm=" + bm.Text);
            if (bmdt.Rows.Count > 0)
            {
                DataTable bmudt = SqlHelper.ExecuteTable("select * from ZL_Pub_code where Pubstart=1 And bm=" + bm.Text);
                if (bmudt.Rows.Count > 0)
                {
                    function.WriteErrMsg("该编码已使用,请重新输入!");
                }
                else
                {
                    pubMod = pubBll.SelReturnModel(PubID);
                    string    Mdata = "[{PubContentid:'" + bm.Text + "',PubTitle:'业绩信息',PubContent:'" + PubContent.Text + "',bm:'" + bm.Text + "'}]";
                    DataTable dt    = JsonConvert.DeserializeObject <DataTable>(Mdata);
                    ForDataColumn(pubMod, dt);
                    DataRow dr = dt.Rows[0];
                    if (DBCenter.Insert(pubMod.PubTableName, BLLCommon.GetFields(dr), BLLCommon.GetParas(dr), BLLCommon.GetParameters(dr)) > 0)
                    {
                        M_Uinfo umub = buser.GetUserBaseByuserid(mu.UserID);
                        switch (umub.Province)
                        {
                        case "北京":
                            money = 10;
                            break;

                        default:
                            break;
                        }
                        buser.ChangeVirtualMoney(mu.UserID, new M_UserExpHis()
                        {
                            score     = 10,
                            ScoreType = 1,
                            detail    = "销售产品获得资金:" + money + ",业绩编码:" + bm.Text
                        });
                        function.WriteSuccessMsg("销售成功!", "/User/Info/ConsumeDetail1.aspx?SType=1");
                    }
                }
            }
            else
            {
                function.WriteErrMsg("该编码无效,请重新输入!");
            }
        }
    }
Example #10
0
 public int AddLabel(M_Zone_Node model)
 {
     return(Sql.insert(strTableName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Example #11
0
 public int Insert(Appinfo model)
 {
     return(Sql.insertID(TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Example #12
0
 public int Insert(M_Publish_Node model)
 {
     return(Sql.insert(model.TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Example #13
0
 public int Insert(M_User_Plat model)
 {
     SyncUB(model);
     model.PK = "";
     return(Sql.insert("ZL_User_Plat", model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Example #14
0
 public int Insert(M_EDU_AutoPK model)
 {
     return(Sql.insertID(TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Example #15
0
 public int Insert(M_Shop_FareTlp model)
 {
     return(Sql.insertID(TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Example #16
0
        public int Add(M_PageReg m_PageReg)
        {
            string strSQL = "INSERT INTO [" + strTableName + "](" + BLLCommon.GetFields(m_PageReg) + ")VALUES(" + BLLCommon.GetParas(m_PageReg) + ")";

            return(DataConverter.CLng(SqlHelper.ExecuteScalar(CommandType.Text, strSQL, m_PageReg.GetParameters())));
        }
Example #17
0
 public static int Insert(M_Com_VisitCount model)
 {
     return(Sql.insertID(model.TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Example #18
0
 public int Insert(M_IDC_Sites model)
 {
     return(Sql.insert(TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Example #19
0
 public int Insert(M_IDC_DomainList model)
 {
     return(Sql.insertID(strTableName, model.GetParameters(model), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Example #20
0
 public int Insert(M_User_UnitWeek model)
 {
     return(Sql.insert(TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Example #21
0
 public int Insert(M_Plat_File model)
 {
     return(Sql.insert(TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Example #22
0
 public int insert(M_PlanSql model)
 {
     return(Sql.insertID(strTableName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Example #23
0
 public int Insert(M_Content_FileBuy model)
 {
     return(Sql.insertID(TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Example #24
0
 public int Insert(DataRow dr, string pk = "id")
 {
     return(Sql.insertID(TbName, BLLCommon.GetParameters(dr, pk), BLLCommon.GetParas(dr, pk), BLLCommon.GetFields(dr, pk)));
 }
Example #25
0
        public int Insert(M_CRMS_Client model, DataTable table)
        {
            int itemid = 0;

            if (!string.IsNullOrEmpty(model.ModelTable) && table.Rows.Count > 0)
            {
                itemid = DBCenter.Insert(model.ModelTable, BLLCommon.GetFields(table), BLLCommon.GetParas(table), BLLCommon.GetParameters(table).ToArray());
            }
            model.ItemID = itemid;
            return(DBCenter.Insert(model));
        }
        public void CreateLink()
        {
            int      Mid     = DataConverter.CLng(Request["ID"]);
            M_QrCode codeMod = null;

            if (Mid > 0)
            {
                codeMod = codeBll.SelReturnModel(Mid);
            }
            if (codeMod == null)
            {
                codeMod = new M_QrCode();
            }
            codeMod.UserName = Request.Form["alias_t"].Trim();
            codeMod.Urls     = DeviceHelper.Agent.Android + "$" + StrHelper.UrlDeal(Request.Form["android_t"].Trim()) + ","
                               + DeviceHelper.Agent.iPhone + "$" + StrHelper.UrlDeal(Request.Form["iphone_t"].Trim()) + ","
                               + DeviceHelper.Agent.iPad + "$" + StrHelper.UrlDeal(Request.Form["ipad_t"].Trim()) + ","
                               + DeviceHelper.Agent.WindowsPhone + "$" + StrHelper.UrlDeal(Request.Form["wphone_t"].Trim()) + ","
                               + DeviceHelper.Agent.PC + "$" + StrHelper.UrlDeal(Request.Form["pc_t"].Trim());
            if (codeMod.ID <= 0)
            {
                codeMod.AppID = DataConverter.CLng(function.GetRandomString(6, 2));
                codeMod.ID    = Sql.insertID(codeBll.strTableName, codeMod.GetParameters(codeMod), BLLCommon.GetParas(codeMod), BLLCommon.GetFields(codeMod));
            }
            else
            {
                codeBll.UpdateByID(codeMod);
            }
            Response.Redirect("CL?ID=" + codeMod.ID);
        }
Example #27
0
 //-----------------Insert
 public int Insert(M_IDC_DNSTable model)
 {
     return(Sql.insert(strTableName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Example #28
0
 public int Insert(M_OA_Borrow model)
 {
     return(Sql.insertID(TbName, model.GetParameters(model), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Example #29
0
 /// <summary>
 /// 添加版位
 /// </summary>
 /// <param name="adZone"></param>
 /// <returns></returns>
 static bool ADZone_Adds(M_Adzone model)
 {
     Sql.insert(model.TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model));
     return(true);
 }
Example #30
0
 public int Insert(M_Exam_Answer model)
 {
     return(Sql.insertID(TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }