コード例 #1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            BusinessLayer.Common.AgentMaster objAgentMaster = new BusinessLayer.Common.AgentMaster();
            Entity.Common.AgentMaster        agent          = new Entity.Common.AgentMaster();
            agent.AgentId       = AgentId;
            agent.AgentCode     = txtAgentCode.Text.Trim();
            agent.AgentName     = txtAgentName.Text.Trim();
            agent.Address       = txtAddress.Text.Trim();
            agent.PhoneNo       = txtPhoneNo.Text.Trim();
            agent.StateId       = Convert.ToInt32(ddlState.SelectedValue);
            agent.DistrictId    = Convert.ToInt32(ddlDistrict.SelectedValue);
            agent.BlockId       = Convert.ToInt32(ddlBlock.SelectedValue);
            agent.BankName      = txtBankName.Text.Trim();
            agent.BranchName    = txtBranchName.Text.Trim();
            agent.BranchAddress = txtBranchAddress.Text.Trim();
            agent.IFSCCode      = txtIFSCCode.Text.Trim();
            agent.IsActive      = ChkIsActive.Checked;
            agent.CreatedBy     = Convert.ToInt32(Session["UserId"].ToString());

            objAgentMaster.Save(agent);
            ClearControls();
            LoadAgentList();
            txtAgentCode.Text = agent.AgentCode;

            Message.IsSuccess = true;
            Message.Text      = "Area Manager Detail Saved Successfully";
            Message.Show      = true;
        }
コード例 #2
0
        public static void Save(Entity.Common.AgentMaster agent)
        {
            using (DataManager oDm = new DataManager())
            {
                oDm.Add("@pAgentId", SqlDbType.Int, ParameterDirection.Input, agent.AgentId);
                oDm.Add("@pAgentCode", SqlDbType.VarChar, 50, ParameterDirection.InputOutput, agent.AgentCode);
                oDm.Add("@pAgentName", SqlDbType.VarChar, 100, ParameterDirection.Input, agent.AgentName);

                oDm.Add("@pAddress", SqlDbType.VarChar, 255, ParameterDirection.Input, agent.Address);
                oDm.Add("@pPhoneNo", SqlDbType.VarChar, 20, ParameterDirection.Input, agent.PhoneNo);
                oDm.Add("@pStateId", SqlDbType.Int, ParameterDirection.Input, agent.StateId);
                oDm.Add("@pDistrictId", SqlDbType.Int, ParameterDirection.Input, agent.DistrictId);
                oDm.Add("@pBlockId", SqlDbType.Int, ParameterDirection.Input, agent.BlockId);
                oDm.Add("@pBankName", SqlDbType.VarChar, 100, ParameterDirection.Input, agent.BankName);
                oDm.Add("@pBranchName", SqlDbType.VarChar, 100, ParameterDirection.Input, agent.BranchName);
                oDm.Add("@pBranchAddress", SqlDbType.VarChar, 255, ParameterDirection.Input, agent.BranchAddress);
                oDm.Add("@pIFSCCode", SqlDbType.VarChar, 20, ParameterDirection.Input, agent.IFSCCode);
                oDm.Add("@pIsActive", SqlDbType.Bit, ParameterDirection.Input, agent.IsActive);
                oDm.Add("@pCreatedBy", SqlDbType.Int, ParameterDirection.Input, agent.CreatedBy);

                oDm.CommandType = CommandType.StoredProcedure;
                oDm.ExecuteNonQuery("usp_AgentMaster_Save");
                agent.AgentCode = (string)oDm["@pAgentCode"].Value;
            }
        }
コード例 #3
0
 public void Save(Entity.Common.AgentMaster agent)
 {
     DataAccess.Common.AgentMaster.Save(agent);
 }