Exemplo n.º 1
0
        public void BtnDelete_Click(object sender, EventArgs e)
        {
            int id = ConvertHelper.Cint(GridViewHelper.GetSelectedKey(Grid1, true));

            string[] eCell = Grid1.SelectedCell;

            JArray    upJson = Grid1.GetMergedData();
            DataTable da     = new DataTable();

            for (int i = 0; i < upJson.Count; i++)
            {
                if (upJson[i]["status"].ToString() != "newadded" && upJson[i]["id"].ToString() == eCell[0].ToString())
                {
                    int _id = ConvertHelper.Cint(upJson[i]["values"]["Id"].ToString());
                    Grid1.DeleteSelectedRows();
                    ORDER_DEP00Bll.GetInstence().DeleteOrderDep00(_id);
                    hidORDDEP_ID.Text = "";
                    break;
                }
                else if (upJson[i]["status"].ToString() == "newadded" && upJson[i]["id"].ToString() == eCell[0].ToString())
                {
                    Grid1.DeleteSelectedRows();
                    hidORDDEP_ID.Text = "";
                    break;
                }
            }
            LoadData2("");
            LoadDepData();
        }
Exemplo n.º 2
0
        /// <summary>
        /// OrderDep00保存
        /// </summary>
        /// <returns></returns>
        public string OrderDep00Save(JArray upJson)
        {
            string result = "";

            for (int i = 0; i < upJson.Count; i++)
            {
                try
                {
                    int _Id   = ConvertHelper.Cint(upJson[i]["values"]["Id"].ToString());
                    var model = new ORDER_DEP00(x => x.Id == _Id);
                    if (upJson[i]["status"].ToString() == "newadded")
                    {
                        model.ORDDEP_ID = TABLE_SEEDBll.GetInstence().GetTableSeed("ORDER_DEP00", "", 0);
                    }
                    else
                    {
                        model.ORDDEP_ID = upJson[i]["values"]["ORDDEP_ID"].ToString();
                    }
                    model.ORDDEP_NAME = upJson[i]["values"]["ORDDEP_NAME"].ToString();
                    model.ORDER_WEEK  = upJson[i]["values"]["ORDER_WEEK"].ToString();
                    //string a = upJson[i]["values"]["USABLE"].ToString();
                    if (upJson[i]["values"]["USABLE"].ToString() == "True")
                    {
                        model.USABLE = 1;
                    }
                    else
                    {
                        model.USABLE = 0;
                    }

                    model.CRT_USER_ID  = upJson[i]["values"]["CRT_USER_ID"].ToString();
                    model.CRT_DATETIME = DateTime.Now;
                    var OlUser = OnlineUsersBll.GetInstence().GetModelForCache(x => x.UserHashKey == Session[OnlineUsersTable.UserHashKey].ToString());
                    model.MOD_DATETIME = DateTime.Now;
                    model.MOD_USER_ID  = OlUser.Manager_LoginName;
                    ORDER_DEP00Bll.GetInstence().Save(this, model);
                }
                catch (Exception err)
                {
                    result = result + upJson[i]["values"]["ORDDEP_NAME"].ToString() + "相关数据保存失败" + Environment.NewLine;
                }
            }
            if (String.IsNullOrEmpty(result))
            {
                result = "";
            }
            //int i = aa.Count;

            return(result);
        }
Exemplo n.º 3
0
 /// <summary>
 /// 初始化对象
 /// </summary>
 public override void Init()
 {
     bll = ORDER_DEP00Bll.GetInstence();
     //throw new NotImplementedException();
 }