Exemple #1
0
        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());

                trcintasm        obj         = JavaScriptConvert.DeserializeObject <trcintasm>(ht["params"].ToString());
                List <trcintadt> listDtl     = JavaScriptConvert.DeserializeObject <List <trcintadt> >(ht["dtlparams"].ToString());
                List <string>    listDeleted = JavaScriptConvert.DeserializeObject <List <string> >(ht["dtldeletedline"].ToString());

                rcintasmBll bll = new rcintasmBll();

                bll.UpdateRecruitmentAssessment(obj, listDtl, listDeleted);
                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);
        }
Exemple #2
0
        public void CreateRecruitmentAssessment(trcintasm obj, List <trcintadt> listDtl)
        {
            try
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    DoInsert <trcintasm>(obj);

                    for (int i = 0; i < listDtl.Count; i++)
                    {
                        DoInsert <trcintadt>(listDtl[i]);
                    }

                    scope.Complete();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #3
0
        public void UpdateRecruitmentAssessment(trcintasm obj, List <trcintadt> listDtl, List <string> listDeleted)
        {
            try
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    List <ColumnInfo> lstParameters = new List <ColumnInfo>()
                    {
                        new ColumnInfo()
                        {
                            ColumnName = "iacd", ColumnValue = obj.iacd
                        }
                    };

                    DoUpdate <trcintasm>(obj, lstParameters);

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

                        new BaseBll().DoDelete <trcintadt>(_parameters);
                    }

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

                        List <trcintadt> lstObj = GetSelectedRecords <trcintadt>(_parameters);

                        if (lstObj.Count > 0)
                        {
                            DoUpdate <trcintadt>(listDtl[i], _parameters);
                        }
                        else
                        {
                            DoInsert <trcintadt>(listDtl[i]);
                        }
                    }

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