Пример #1
0
        public static List <ATTCauseList> GetCauseList(int?CauseListID, string active, int defaultFlag)
        {
            List <ATTCauseList> CauseList = new List <ATTCauseList>();

            try
            {
                foreach (DataRow row in DLLCauseList.GetCauseList(CauseListID, active).Rows)
                {
                    ATTCauseList cslst = new ATTCauseList(
                        int.Parse(row["CL_ENTRY_TYPE_ID"].ToString()),
                        row["CL_ENTRY_TYPE_NAME"].ToString(),
                        row["ACTIVE"].ToString());
                    CauseList.Add(cslst);
                }

                if (defaultFlag > 0)
                {
                    CauseList.Insert(0, new ATTCauseList(0, "छान्नुहोस", ""));
                }
                return(CauseList);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #2
0
 public static bool SaveCauseList(ATTCauseList objCauseList)
 {
     try
     {
         return(DLLCauseList.SaveCauseList(objCauseList));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #3
0
        public static bool SaveCauseList(ATTCauseList objCauseList)
        {
            string InsertUpdateSQL            = "";
            List <OracleParameter> paramArray = new List <OracleParameter>();

            paramArray.Add(Utilities.GetOraParam(":P_CL_ENTRY_TYPE_ID", objCauseList.CauseListID, OracleDbType.Int64, ParameterDirection.InputOutput));
            paramArray.Add(Utilities.GetOraParam(":P_CL_ENTRY_TYPE_NAME", objCauseList.CauseListName, OracleDbType.Varchar2, ParameterDirection.Input));
            paramArray.Add(Utilities.GetOraParam(":P_ACTIVE", objCauseList.Active, OracleDbType.Varchar2, ParameterDirection.Input));
            paramArray.Add(Utilities.GetOraParam(":P_ENTRY_BY", objCauseList.EntryBy, OracleDbType.Varchar2, ParameterDirection.Input));

            if (objCauseList.Action == "A")
            {
                InsertUpdateSQL = "SP_ADD_CL_ENTRY_TYPE";
            }
            else if (objCauseList.Action == "E")
            {
                InsertUpdateSQL = "SP_EDIT_CL_ENTRY_TYPE";
            }
            GetConnection     GetConn = new GetConnection();
            OracleTransaction Tran    = GetConn.GetDbConn(Module.CMS).BeginTransaction();

            try
            {
                SqlHelper.ExecuteNonQuery(Tran, System.Data.CommandType.StoredProcedure, InsertUpdateSQL, paramArray.ToArray());
                objCauseList.CauseListID = int.Parse(paramArray[0].Value.ToString());
                Tran.Commit();
                return(true);
            }
            catch (OracleException oex)
            {
                PCS.COREDL.OracleError oe = new PCS.COREDL.OracleError();
                throw new ArgumentException(oe.GetOraError(oex.Number, oex.Message));
            }

            catch (Exception ex)
            {
                Tran.Rollback();
                throw ex;
            }
            finally
            {
                GetConn.CloseDbConn();
            }
        }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        ATTCauseList objCauseList = new ATTCauseList(int.Parse(this.hdnFldCauseListID.Value), this.txtCauseList.Text.Trim(), this.chkActive.Checked == true ? "Y" : "F");

        if (this.lstCauseList.SelectedIndex > -1)
        {
            objCauseList.Action = "E";
        }
        else
        {
            objCauseList.Action = "A";
        }
        objCauseList.EntryBy = strUser;
        try
        {
            List <ATTCauseList> ListCauseList = (List <ATTCauseList>)Session["CauseList"];
            BLLCauseList.SaveCauseList(objCauseList);
            if (this.lstCauseList.SelectedIndex > -1)
            {
                ListCauseList[this.lstCauseList.SelectedIndex].CauseListID   = objCauseList.CauseListID;
                ListCauseList[this.lstCauseList.SelectedIndex].CauseListName = objCauseList.CauseListName;
                ListCauseList[this.lstCauseList.SelectedIndex].Active        = objCauseList.Active;
            }
            else
            {
                ListCauseList.Add(objCauseList);
            }
            this.lstCauseList.DataSource = ListCauseList;
            this.lstCauseList.DataBind();
            ClearControls();
            this.lblStatusMessage.Text = "CauseList Items Successfully Saved.";
            this.programmaticModalPopup.Show();
        }
        catch (Exception ex)
        {
            this.lblStatusMessage.Text = ex.Message;
            this.programmaticModalPopup.Show();
        }
    }