示例#1
0
 void BindState()
 {
     oblState = new Store.State.BusinessLogic.State();
     try
     {
         objStatelist = oblState.GetAllStateList(0, 0, "");
         if (objStatelist != null)
         {
             dgvState.DataSource = objStatelist;
             dgvState.DataBind();
         }
         else
         {
             dgvState.DataSource = null;
             dgvState.DataBind();
         }
     }
     catch (Exception ex)
     {
         Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(State).FullName, 1);
     }
     finally
     {
         oblState     = null;
         objStatelist = null;
     }
 }
示例#2
0
 void BindState(int id)
 {
     oblState = new Store.State.BusinessLogic.State();
     try
     {
         objStatelist = oblState.GetAllStateList(id, 0, "");
         if (objStatelist != null)
         {
             ListItem al = new ListItem("<-Select State->", "0", true);
             ddlState.DataSource     = objStatelist;
             ddlState.DataTextField  = "StateName";
             ddlState.DataValueField = "StateID";
             ddlState.DataBind();
             ddlState.Items.Insert(0, al);
         }
         else
         {
             ddlState.DataSource = null;
             ddlState.DataBind();
         }
     }
     catch (Exception ex)
     {
         throw;
     }
     finally
     {
         oblState     = null;
         objStatelist = null;
     }
 }
示例#3
0
 void bindState(int id)
 {
     oblState = new Store.State.BusinessLogic.State();
     try
     {
         objStatelist = oblState.GetAllStateList(id, 0, "");
         if (objStatelist != null)
         {
             ListItem al = new ListItem("<-Select State->", "0", true);
             ddlStateID.DataSource     = objStatelist;
             ddlStateID.DataTextField  = "StateName";
             ddlStateID.DataValueField = "StateID";
             ddlStateID.DataBind();
             ddlStateID.Items.Insert(0, al);
         }
         else
         {
             ddlStateID.DataSource = null;
             ddlStateID.DataBind();
         }
     }
     catch (Exception ex)
     {
         Store.Common.Utility.ExceptionLog.Exceptionlogs(ex.Message, Store.Common.Utility.ExceptionLog.LineNumber(ex), typeof(UserInfo).FullName, 1);
     }
     finally
     {
         oblState     = null;
         objStatelist = null;
     }
 }
示例#4
0
文件: DLState.cs 项目: dkdeepak/SMIS
        public Store.State.BusinessObject.StateList GetAllStateList(int StateID, int Flag, string FlagValue)
        {
            Store.State.BusinessObject.State     objState     = null;
            Store.State.BusinessObject.StateList objStateList = null;
            string          SQL       = string.Empty;
            ParameterList   paramList = new ParameterList();
            DataTableReader dr;

            try
            {
                SQL          = "proc_State";
                objStateList = new BusinessObject.StateList();
                paramList.Add(new SQLParameter("@StateID", StateID));
                paramList.Add(new SQLParameter("@Flag", Flag));
                paramList.Add(new SQLParameter("@FlagValue", FlagValue));
                dr = ExecuteQuery.ExecuteReader(SQL, paramList);
                while (dr.Read())
                {
                    objState = new BusinessObject.State();
                    if (dr.IsDBNull(dr.GetOrdinal("StateID")) == false)
                    {
                        objState.StateID = dr.GetInt32(dr.GetOrdinal("StateID"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("StateName")) == false)
                    {
                        objState.StateName = dr.GetString(dr.GetOrdinal("StateName"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("CountryID")) == false)
                    {
                        objState.CountryID = dr.GetInt32(dr.GetOrdinal("CountryID"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("CountryName")) == false)
                    {
                        objState.CountryName = dr.GetString(dr.GetOrdinal("CountryName"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("CreatedBy")) == false)
                    {
                        objState.CreatedBy = dr.GetInt32(dr.GetOrdinal("CreatedBy"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("CreatedOn")) == false)
                    {
                        objState.CreatedOn = dr.GetDateTime(dr.GetOrdinal("CreatedOn"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("ModifiedBy")) == false)
                    {
                        objState.ModifiedBy = dr.GetInt32(dr.GetOrdinal("ModifiedBy"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("ModifiedOn")) == false)
                    {
                        objState.ModifiedOn = dr.GetDateTime(dr.GetOrdinal("ModifiedOn"));
                    }
                    if (dr.IsDBNull(dr.GetOrdinal("ReferenceID")) == false)
                    {
                        objState.ReferenceID = dr.GetInt32(dr.GetOrdinal("ReferenceID"));
                    }
                    objStateList.Add(objState);
                }
                dr.Close();
                return(objStateList);
            }
            catch (Exception ex)
            {
                throw;
            }
        }