Esempio n. 1
0
        private bool DoEdit(int _id)
        {
            bool result = false;

            BLL.basic   bll   = new BLL.basic();
            Model.basic model = bll.GetModel(_id);

            model.basic_label = txtbasic_label.Text.Trim();
            model.basic_sort  = int.Parse(txtSortId.Text);
            if (cbIsLock.Checked)
            {
                model.basic_type = "2";
            }
            else
            {
                model.basic_type = "1";
            }
            if (bll.Update(model))
            {
                AddAdminLog(TWEnums.ActionEnum.Edit.ToString(), "修改分區設定:" + model.basic_label); //記錄日誌
                result = true;
            }

            return(result);
        }
Esempio n. 2
0
        private bool DoAdd()
        {
            bool result = false;

            Model.basic model = new Model.basic();
            BLL.basic   bll   = new BLL.basic();
            model.basic_type  = txtbasic_type.SelectedValue.Trim();
            model.basic_label = txtbasic_label.Text.Trim();
            model.basic_sort  = int.Parse(txtSortId.Text);
            model.basic_show  = 1;


            model.basic_where = "city";
            int a = bll.Add(model);

            Model.basic model1 = bll.GetModel(a);
            if (a > 0)
            {
                model1.basic_value = a.ToString();
                bll.Update(model1);
                AddAdminLog(TWEnums.ActionEnum.Add.ToString(), "添加國家設定:" + model.basic_label); //記錄日誌
                result = true;
            }
            return(result);
        }
Esempio n. 3
0
        private bool DoAdd()
        {
            bool result = false;

            Model.basic model = new Model.basic();
            BLL.basic   bll   = new BLL.basic();

            model.basic_label = txtbasic_label.Text.Trim();
            model.basic_sort  = int.Parse(txtSortId.Text);
            model.basic_show  = 1;
            if (cbIsLock.Checked)
            {
                model.basic_type = "2";
            }
            else
            {
                model.basic_type = "1";
            }

            model.basic_where = "qu";
            int a = bll.Add(model);

            Model.basic model1 = bll.GetModel(a);
            if (a > 0)
            {
                model1.basic_value = a.ToString();
                bll.Update(model1);
                AddAdminLog(TWEnums.ActionEnum.Add.ToString(), "添加分區設定:" + model.basic_label); //記錄日誌
                result = true;
            }
            return(result);
        }
Esempio n. 4
0
        private bool DoAdd()
        {
            bool result = false;

            Model.basic model = new Model.basic();
            BLL.basic   bll   = new BLL.basic();

            model.basic_label = txtbasic_label.Text.Trim();
            model.basic_sort  = Utils.StrToInt(txtYun.Text, 0);
            model.basic_money = Utils.StrToDecimal(txtSortId.Text, 0);
            model.basic_type  = ddlCategoryId.SelectedValue;
            //model.basic_pic = txtbasic_pic.Text;
            model.basic_where = "yunfei";
            int a = bll.Add(model);

            Model.basic model1 = bll.GetModel(a);
            if (a > 0)
            {
                model1.basic_value = a.ToString();
                bll.Update(model1);
                AddAdminLog(TWEnums.ActionEnum.Add.ToString(), "添加運費設定:" + model.basic_label); //記錄日誌
                result = true;
            }
            return(result);
        }
Esempio n. 5
0
 private void ShowInfo(int _id)
 {
     BLL.basic   bll   = new BLL.basic();
     Model.basic model = bll.GetModel(_id);
     txtSortId.Text              = model.basic_money.GetValueOrDefault().ToString("0.00");
     txtbasic_label.Text         = model.basic_label;
     txtYun.Text                 = model.basic_sort.Value.ToString();
     ddlCategoryId.SelectedValue = model.basic_type;
     //txtbasic_pic.Text = model.basic_pic;
 }
Esempio n. 6
0
 private void ShowInfo(int _id)
 {
     BLL.basic   bll   = new BLL.basic();
     Model.basic model = bll.GetModel(_id);
     txtSortId.Text      = model.basic_sort.Value.ToString();
     txtbasic_label.Text = model.basic_label;
     if (model.basic_type == "2")
     {
         cbIsLock.Checked = true;
     }
 }
Esempio n. 7
0
        private bool DoEdit(int _id)
        {
            bool result = false;

            BLL.basic   bll   = new BLL.basic();
            Model.basic model = bll.GetModel(_id);
            model.basic_type  = txtbasic_type.SelectedValue.Trim();
            model.basic_label = txtbasic_label.Text.Trim();
            model.basic_sort  = int.Parse(txtSortId.Text);

            if (bll.Update(model))
            {
                AddAdminLog(TWEnums.ActionEnum.Edit.ToString(), "修改國家設定:" + model.basic_label); //記錄日誌
                result = true;
            }

            return(result);
        }
Esempio n. 8
0
 //儲存排序
 protected void btnSave_Click(object sender, EventArgs e)
 {
     //ChkAdminLevel("plugin_link", TWEnums.ActionEnum.Edit.ToString()); //檢查權限
     BLL.basic bll = new BLL.basic();
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
         int sortId;
         if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId))
         {
             sortId = 99;
         }
         Model.basic model = bll.GetModel(id);
         model.basic_sort = sortId;
         bll.Update(model);
     }
     AddAdminLog(TWEnums.ActionEnum.Edit.ToString(), "修改問題類型排序:"); //記錄日誌
     JscriptMsg("儲存排序成功!", Utils.CombUrlTxt("list.aspx", "keywords={0}", this.keywords));
 }
Esempio n. 9
0
        private bool DoEdit(int _id)
        {
            bool result = false;

            BLL.basic   bll   = new BLL.basic();
            Model.basic model = bll.GetModel(_id);
            model.basic_label = txtbasic_label.Text.Trim();
            model.basic_sort  = Utils.StrToInt(txtYun.Text, 0);
            model.basic_money = Utils.StrToDecimal(txtSortId.Text, 0);
            //model.basic_pic = txtbasic_pic.Text;
            model.basic_type = ddlCategoryId.SelectedValue;
            if (bll.Update(model))
            {
                AddAdminLog(TWEnums.ActionEnum.Edit.ToString(), "修改運費設定:" + model.basic_label); //記錄日誌
                result = true;
            }

            return(result);
        }
Esempio n. 10
0
        //將excel的資料寫入資料庫
        private string InsertGoods(DataTable dt)
        {
            string result = "";

            BLL.basic   bll   = new BLL.basic();
            Model.basic model = null;

            //判斷列名是否規範
            string[] strColumn = { "分區", "編號", "重量", "費用" };
            int      num       = 0;

            for (int i = 0; i < dt.Columns.Count; i++)
            {
                foreach (string str in strColumn)
                {
                    if (str == dt.Columns[i].ColumnName)
                    {
                        num++;
                    }
                }
            }

            if (num == strColumn.Length)
            {
                //遍歷主件

                foreach (DataRow dr in dt.Rows)
                {
                    if (dr[0].ToString().Trim() != "" && dr[1].ToString().Trim() != "" && dr[2].ToString().Trim() != "" && dr[3].ToString().Trim() != "")
                    {
                        bool update = true;
                        try
                        {
                            model = bll.GetModel(dr[1].ToString());
                        }
                        catch (Exception eee) { }
                        if (model == null)
                        {
                            model  = new Model.basic();
                            update = false;
                        }

                        model.basic_type  = gettype(dr[0].ToString());
                        model.basic_label = dr[1].ToString();
                        model.basic_sort  = Utils.StrToInt(dr[3].ToString(), 0);
                        model.basic_money = Utils.StrToDecimal(dr[2].ToString(), 0);
                        if (update)
                        {
                            bll.Update(model);
                        }
                        else
                        {
                            model.basic_where = "yunfei";
                            int         a      = bll.Add(model);
                            Model.basic model1 = bll.GetModel(a);

                            if (a > 0)
                            {
                                model1.basic_value = a.ToString();
                                bll.Update(model1);
                            }
                        }
                    }
                }
            }
            else
            {
                result = "請檢查excel檔案格式!" + num + strColumn.Length;
            }
            return(result);
        }