public static List <ATTCheckList> GetCheckList(int?checkListID, string active, int defaultFlag)
        {
            List <ATTCheckList> CheckList = new List <ATTCheckList>();

            try
            {
                foreach (DataRow row in DLLCheckList.GetCheckList(checkListID, active).Rows)
                {
                    ATTCheckList chklst = new ATTCheckList(
                        int.Parse(row["CHECK_LIST_ID"].ToString()),
                        row["CHECK_LIST_NAME"].ToString(),
                        row["ACTIVE"].ToString());
                    chklst.CheckListType = row["CHECK_LIST_TYPE"].ToString();
                    CheckList.Add(chklst);
                }

                if (defaultFlag > 0)
                {
                    CheckList.Insert(0, new ATTCheckList(0, "छान्नुहोस", ""));
                }
                return(CheckList);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 public static bool SaveCheckList(ATTCheckList objCheckList)
 {
     try
     {
         return(DLLCheckList.SaveCheckList(objCheckList));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #3
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (this.ddlCheckListType.SelectedIndex == 0)
        {
            this.lblStatusMessage.Text = "चेकलिष्टको किसिम छान्नहोस।";
            this.programmaticModalPopup.Show();
            return;
        }
        ATTCheckList objCheckList = new ATTCheckList(int.Parse(this.hdnFldCheckListID.Value), this.txtCheckList.Text.Trim(), this.chkActive.Checked == true ? "Y" : "F");

        objCheckList.CheckListType = this.ddlCheckListType.SelectedValue;
        if (this.lstCheckList.SelectedIndex > -1)
        {
            objCheckList.Action = "E";
        }
        else
        {
            objCheckList.Action = "A";
        }
        objCheckList.EntryBy = strUser;
        try
        {
            List <ATTCheckList> ListCheckList = (List <ATTCheckList>)Session["CheckList"];
            BLLCheckList.SaveCheckList(objCheckList);
            if (this.lstCheckList.SelectedIndex > -1)
            {
                ListCheckList[this.lstCheckList.SelectedIndex].CheckListID   = objCheckList.CheckListID;
                ListCheckList[this.lstCheckList.SelectedIndex].CheckListName = objCheckList.CheckListName;
                ListCheckList[this.lstCheckList.SelectedIndex].Active        = objCheckList.Active;
                ListCheckList[this.lstCheckList.SelectedIndex].CheckListType = objCheckList.CheckListType;
            }
            else
            {
                ListCheckList.Add(objCheckList);
            }
            this.lstCheckList.DataSource = ListCheckList;
            this.lstCheckList.DataBind();
            ClearControls();
            this.lblStatusMessage.Text = "CheckList Items Successfully Saved.";
            this.programmaticModalPopup.Show();
        }
        catch (Exception ex)
        {
            this.lblStatusMessage.Text = ex.Message;
            this.programmaticModalPopup.Show();
        }
    }
        public static bool SaveCheckList(ATTCheckList objCheckList)
        {
            string InsertUpdateSQL            = "";
            List <OracleParameter> paramArray = new List <OracleParameter>();

            paramArray.Add(Utilities.GetOraParam(":P_CHECK_LIST_ID", objCheckList.CheckListID, OracleDbType.Int64, ParameterDirection.InputOutput));
            paramArray.Add(Utilities.GetOraParam(":P_CHECK_LIST_NAME", objCheckList.CheckListName, OracleDbType.Varchar2, ParameterDirection.Input));
            paramArray.Add(Utilities.GetOraParam(":P_ACTIVE", objCheckList.Active, OracleDbType.Varchar2, ParameterDirection.Input));
            paramArray.Add(Utilities.GetOraParam(":P_CHECK_LIST_TYPE", objCheckList.CheckListType, OracleDbType.Varchar2, ParameterDirection.Input));
            paramArray.Add(Utilities.GetOraParam(":P_ENTRY_BY", objCheckList.EntryBy, OracleDbType.Varchar2, ParameterDirection.Input));
            if (objCheckList.Action == "A")
            {
                InsertUpdateSQL = "SP_ADD_CHECK_LIST";
            }
            else if (objCheckList.Action == "E")
            {
                InsertUpdateSQL = "SP_EDIT_CHECK_LIST";
            }
            GetConnection     GetConn = new GetConnection();
            OracleTransaction Tran    = GetConn.GetDbConn(Module.CMS).BeginTransaction();

            try
            {
                SqlHelper.ExecuteNonQuery(Tran, System.Data.CommandType.StoredProcedure, InsertUpdateSQL, paramArray.ToArray());
                objCheckList.CheckListID = 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();
            }
        }