コード例 #1
0
ファイル: rcintrstController.cs プロジェクト: zxlnet/hrms
        public void getEdit()
        {
            string message = "{}";

            try
            {
                string    record = this.Request["record"];
                Hashtable ht     = JavaScriptConvert.DeserializeObject <Hashtable>(record);

                List <ColumnInfo> parameters = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(ht["keycolumns"].ToString());

                trcintrst        obj     = JavaScriptConvert.DeserializeObject <trcintrst>(ht["params"].ToString());
                List <trcintrdt> listDtl = JavaScriptConvert.DeserializeObject <List <trcintrdt> >(ht["dtlparams"].ToString());

                rcintrstBll bll = new rcintrstBll();

                bll.UpdateInterviewResult(obj, parameters, listDtl);
                message = "{status:'success',msg:'" + HRMSRes.Public_Message_EditWell + "'}";
            }
            catch (Exception ex)
            {
                message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_EditBad, ex, true) + "'}";
            }
            Response.Write(message);
        }
コード例 #2
0
ファイル: rcintrstBll.cs プロジェクト: zxlnet/hrms
        public void UpdateInterviewResult(trcintrst obj, List <ColumnInfo> parameters, List <trcintrdt> listDtl)
        {
            try
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    List <ColumnInfo> lstParameter = new List <ColumnInfo>()
                    {
                        new ColumnInfo()
                        {
                            ColumnName = "isno", ColumnValue = obj.isno
                        }
                    };

                    List <trcintrst> lstObj = GetSelectedRecords <trcintrst>(lstParameter);
                    if (lstObj.Count > 0)
                    {
                        DoUpdate <trcintrst>(obj, lstParameter);
                    }
                    else
                    {
                        DoInsert <trcintrst>(obj);
                    }

                    for (int i = 0; i < listDtl.Count; i++)
                    {
                        List <ColumnInfo> _parameters = new List <ColumnInfo>()
                        {
                            new ColumnInfo()
                            {
                                ColumnName = "isno", ColumnValue = obj.isno
                            },
                            new ColumnInfo()
                            {
                                ColumnName = "sqno", ColumnValue = listDtl[i].sqno.ToString(), ColumnType = "int"
                            }
                        };

                        new BaseBll().DoDelete <trcintrdt>(_parameters);
                        DoInsert <trcintrdt>(listDtl[i]);
                    }

                    scope.Complete();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #3
0
ファイル: rcintrstBll.cs プロジェクト: zxlnet/hrms
        public void CreateInterviewResult(trcintrst obj, List <trcintrdt> listDtl)
        {
            try
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    DoInsert <trcintrst>(obj);
                    for (int i = 0; i < listDtl.Count; i++)
                    {
                        DoInsert <trcintrdt>(listDtl[i]);
                    }

                    scope.Complete();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }