protected void LoadMember()
        {
            BusinessLayer.Common.MemberMaster objMember    = new BusinessLayer.Common.MemberMaster();
            Entity.Common.MemberMaster        membermaster = new Entity.Common.MemberMaster();
            if (ddlBlock.SelectedIndex == 0)
            {
                membermaster.BlockId = 0;
            }
            else
            {
                membermaster.BlockId = Convert.ToInt32(ddlBlock.SelectedValue.Trim());
            }

            if (ddlDistrict.SelectedIndex == 0)
            {
                membermaster.DistrictId = 0;
            }
            else
            {
                membermaster.DistrictId = Convert.ToInt32(ddlDistrict.SelectedValue.Trim());
            }

            if (ddlState.SelectedIndex == 0)
            {
                membermaster.StateId = 0;
            }
            else
            {
                membermaster.StateId = Convert.ToInt32(ddlState.SelectedValue.Trim());
            }

            if (ddlMembershipCategory.SelectedIndex == 0)
            {
                membermaster.CategoryId = 0;
            }
            else
            {
                membermaster.CategoryId = Convert.ToInt32(ddlMembershipCategory.SelectedValue.Trim());
            }

            if (txtMemberName.Text == string.Empty)
            {
                membermaster.MemberName = string.Empty;
            }
            else
            {
                membermaster.MemberName = txtMemberName.Text.Trim();
            }


            DataTable dt = objMember.MemberFeesSummery_GetAll(membermaster);

            if (dt != null)
            {
                dgvMemberMaster.DataSource = dt;
                dgvMemberMaster.DataBind();

                DataView dv = new DataView(dt);
                dv.RowFilter        = "IsMember='Yes'";
                lblTotalMember.Text = Convert.ToString(dv.ToTable().Rows.Count);
            }
        }
Exemple #2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                if (IsValidPhoto())
                {
                    BusinessLayer.Common.MemberMaster objMemberMaster = new BusinessLayer.Common.MemberMaster();
                    memberMaster.MemberId        = MemberId;
                    memberMaster.MemberName      = txtMemberName.Text.Trim();
                    memberMaster.MemberCode      = txtMemberCode.Text.Trim();
                    memberMaster.MobileNo        = txtMobileNo.Text.Trim();
                    memberMaster.PhoneId         = txtPhoneNo.Text.Trim();
                    memberMaster.Email           = txtEmail.Text.Trim();
                    memberMaster.VATNo           = txtVATNo.Text.Trim();
                    memberMaster.PANNo           = txtPANNo.Text.Trim();
                    memberMaster.LICNo           = txtLICNo.Text.Trim();
                    memberMaster.GSTNo           = txtGSTNo.Text.Trim();//NEW
                    memberMaster.VillageOrStreet = txtVillageOrStreet.Text.Trim();
                    memberMaster.PlotNo          = txtPlotNo.Text.Trim();
                    memberMaster.KhaitanNo       = txtKhaitanNo.Text.Trim();
                    memberMaster.Mouza           = txtMouza.Text.Trim();
                    memberMaster.JLNo            = txtJLNo.Text.Trim();
                    memberMaster.PO             = txtPO.Text.Trim();
                    memberMaster.PS             = txtPS.Text.Trim();
                    memberMaster.PIN            = txtPIN.Text.Trim();
                    memberMaster.BlockId        = Convert.ToInt32(ddlBlock.SelectedValue);
                    memberMaster.DistrictId     = Convert.ToInt32(ddlDistrict.SelectedValue);
                    memberMaster.StateId        = Convert.ToInt32(ddlState.SelectedValue);
                    memberMaster.CompanyName    = txtCompanyName.Text.Trim();
                    memberMaster.CategoryId     = Convert.ToInt32(ddlMembershipCategory.SelectedValue);
                    memberMaster.IsMember       = chkMember.Checked;
                    memberMaster.MemberGroupId  = Convert.ToInt32(ddlMemberGroup.SelectedValue);
                    memberMaster.BusinessTypeId = Convert.ToInt32(ddlBusinessType.SelectedValue);

                    memberMaster.MembershipDate = Convert.ToDateTime(txtMembershipDate.Text.Trim().Split('/')[2] + "-" + txtMembershipDate.Text.Trim().Split('/')[1] + "-" + txtMembershipDate.Text.Trim().Split('/')[0]);
                    memberMaster.EffectiveDate  = Convert.ToDateTime(txtEffectiveDate.Text.Trim().Split('/')[2] + "-" + txtEffectiveDate.Text.Trim().Split('/')[1] + "-" + txtEffectiveDate.Text.Trim().Split('/')[0]);
                    //memberMaster.OpBal = (txtOpBal.Text.Trim().Length > 0) ? Convert.ToDecimal(txtOpBal.Text.Trim()) : 0;
                    //memberMaster.DrORCr = ddlDRorCR.SelectedValue;
                    memberMaster.LayerCapacityNos           = (txtLayerCapacityNos.Text.Trim().Length > 0) ? txtLayerCapacityNos.Text.Trim() : "";
                    memberMaster.BroilerCapacityNos         = (txtBroilerCapacityNos.Text.Trim().Length > 0) ? txtBroilerCapacityNos.Text.Trim() : "";
                    memberMaster.BreederCapacityNos         = (txtBreederCapacityNos.Text.Trim().Length > 0) ? txtBreederCapacityNos.Text.Trim() : "";
                    memberMaster.EggSellerDailySalesNos     = (txtEggSellerDailySalesNos.Text.Trim().Length > 0) ? txtEggSellerDailySalesNos.Text.Trim() : "";
                    memberMaster.ChickenSellerDailySalesNos = (txtChickenSellerDailySalesNos.Text.Trim().Length > 0) ? txtChickenSellerDailySalesNos.Text.Trim() : "";
                    memberMaster.ChickenSellerDailySalesKgs = (txtChickenSellerDailySalesKgs.Text.Trim().Length > 0) ? txtChickenSellerDailySalesKgs.Text.Trim() : "";
                    memberMaster.FeedProducerDailySalesMT   = (txtFeedProducerDailySalesMT.Text.Trim().Length > 0) ? txtFeedProducerDailySalesMT.Text.Trim() : "";
                    memberMaster.FeedSellerDailySalesMT     = (txtFeedSellerDailySalesMT.Text.Trim().Length > 0) ? txtFeedSellerDailySalesMT.Text.Trim() : "";
                    memberMaster.OtherCategory                   = txtOtherCategory.Text.Trim();
                    memberMaster.Remarks                         = txtRemarks.Text.Trim();
                    memberMaster.UserId                          = 0; // Convert.ToInt32(Session["UserId"].ToString());
                    memberMaster.CompanyId                       = 0; // Convert.ToInt32(Session["CompanyId"].ToString());
                    memberMaster.BranchId                        = 0; // Convert.ToInt32(Session["BranchId"].ToString());
                    memberMaster.FinYearId                       = 0; // Convert.ToInt32(Session["FinYrID"].ToString());
                    memberMaster.DataFlow                        = 0; // Convert.ToInt32(Session["DataFlow"].ToString());
                    memberMaster.Website                         = txtWebsite.Text.Trim();
                    memberMaster.ImageExt                        = Photo;
                    memberMaster.IsGovtMember                    = chkIsGovtMember.Checked;
                    memberMaster.MemberSMSCategoryId             = (ddlMemberSMSCategory.SelectedIndex == 0) ? 0 : int.Parse(ddlMemberSMSCategory.SelectedValue);
                    memberMaster.MobileNo2                       = txtMobileNo2.Text.Trim();
                    memberMaster.Narration                       = txtNarration.Text.Trim();
                    memberMaster.MembershipCategoryEffectiveDate = Convert.ToDateTime(txtMembershipCategoryEffectiveDate.Text.Trim().Split('/')[2] + "-" + txtMembershipCategoryEffectiveDate.Text.Trim().Split('/')[1] + "-" + txtMembershipCategoryEffectiveDate.Text.Trim().Split('/')[0]);

                    memberMaster.IsExecutiveMember = chkExecutiveMember.Checked;
                    objMemberMaster.Save(memberMaster);
                    //txtMemberCode.Text = memberMaster.MemberCode;

                    if (Photo.Trim() != "")
                    {
                        string ff = (Server.MapPath("") + "\\MemberPhoto\\" + memberMaster.MemberId.ToString().Replace("/", "-") + Photo);
                        uploadImage.PostedFile.SaveAs(ff);
                    }

                    //Document Upload Section Start
                    if (MemberId.Equals(0))
                    {
                        Mode = "ADD";
                    }
                    else
                    {
                        Mode = "EDIT";
                    }

                    SaveDocument(memberMaster.MemberId);
                    //Document Upload Section End

                    Message.IsSuccess = true;
                    Message.Text      = (MemberId == 0) ? "Member Registration Successfully Completed." : "Member Details Updated Successfully.";
                    Message.Show      = true;
                    btnSave.Visible   = false;
                }
                else
                {
                    Message.IsSuccess = false;
                    Message.Text      = "Photo should be in .jpg or .jpeg or .png format";
                    Message.Show      = true;
                }
            }
            catch
            {
                Message.IsSuccess = false;
                Message.Text      = "Can Not Save!!!";
            }
            Message.Show = true;
        }
        protected void LoadMember()
        {
            BusinessLayer.Common.MemberMaster objMember    = new BusinessLayer.Common.MemberMaster();
            Entity.Common.MemberMaster        membermaster = new Entity.Common.MemberMaster();
            if (ddlBlock.SelectedIndex == 0)
            {
                membermaster.BlockId = 0;
            }
            else
            {
                membermaster.BlockId = Convert.ToInt32(ddlBlock.SelectedValue.Trim());
            }

            if (ddlDistrict.SelectedIndex == 0)
            {
                membermaster.DistrictId = 0;
            }
            else
            {
                membermaster.DistrictId = Convert.ToInt32(ddlDistrict.SelectedValue.Trim());
            }

            if (ddlState.SelectedIndex == 0)
            {
                membermaster.StateId = 0;
            }
            else
            {
                membermaster.StateId = Convert.ToInt32(ddlState.SelectedValue.Trim());
            }

            if (ddlMembershipCategory.SelectedIndex == 0)
            {
                membermaster.CategoryId = 0;
            }
            else
            {
                membermaster.CategoryId = Convert.ToInt32(ddlMembershipCategory.SelectedValue.Trim());
            }

            if (txtMemberName.Text == string.Empty)
            {
                membermaster.MemberName = string.Empty;
            }
            else
            {
                membermaster.MemberName = txtMemberName.Text.Trim();
            }


            DataTable dt = objMember.GetAll(membermaster);

            if (dt != null)
            {
                dgvMemberMaster.DataSource = dt;
                dgvMemberMaster.DataBind();
            }

            DataTable dtSMS = objMember.SMSSubscription_GetAll(int.Parse(Session["FinYrID"].ToString()));

            if (dtSMS != null)
            {
                foreach (DataRow dr in dtSMS.Rows)
                {
                    foreach (GridViewRow gvr in dgvMemberMaster.Rows)
                    {
                        CheckBox chkSubscribe = (CheckBox)gvr.FindControl("chkSubscribe");

                        if (dr["MemberId"].ToString() == dgvMemberMaster.DataKeys[gvr.RowIndex].Values[0].ToString())
                        {
                            chkSubscribe.Checked = true;
                            chkSubscribe.Enabled = false;

                            if (dr["IsBlocked"].ToString() == "True")
                            {
                                Button btnBlock = (Button)gvr.FindControl("btnBlock");

                                btnBlock.Text = "Unblock";
                                for (int i = 0; i < 10; i++)
                                {
                                    gvr.Cells[i].Style.Add("background-color", "#E5D254");
                                }
                            }
                        }
                    }
                }
            }
        }
Exemple #4
0
        protected void PopulateMemberMaster()
        {
            BusinessLayer.Common.MemberMaster objMemberMaster = new BusinessLayer.Common.MemberMaster();
            memberMaster = objMemberMaster.GetMemberMasterById(MemberId);

            if (memberMaster != null)
            {
                MemberId           = memberMaster.MemberId;
                txtMemberName.Text = memberMaster.MemberName.ToString();
                //txtMemberName.Enabled = false;
                txtMemberCode.Text      = memberMaster.MemberCode.ToString();
                txtMemberCode.Enabled   = false;
                txtMobileNo.Text        = memberMaster.MobileNo.ToString();
                txtPhoneNo.Text         = memberMaster.PhoneId.ToString();
                txtEmail.Text           = memberMaster.Email.ToString();
                txtVATNo.Text           = memberMaster.VATNo.ToString();
                txtPANNo.Text           = memberMaster.PANNo.ToString();
                txtLICNo.Text           = memberMaster.LICNo.ToString();
                txtGSTNo.Text           = memberMaster.GSTNo.ToString();//NEW
                txtVillageOrStreet.Text = memberMaster.VillageOrStreet.ToString();
                txtPlotNo.Text          = memberMaster.PlotNo.ToString();
                txtKhaitanNo.Text       = memberMaster.KhaitanNo.ToString();
                txtMouza.Text           = memberMaster.Mouza.ToString();
                txtJLNo.Text            = memberMaster.JLNo.ToString();
                txtPO.Text  = memberMaster.PO.ToString();
                txtPS.Text  = memberMaster.PS.ToString();
                txtPIN.Text = memberMaster.PIN.ToString();

                ddlState.SelectedValue = memberMaster.StateId.ToString();

                if (memberMaster.IsApproved)
                {
                    ddlState.Enabled = false;
                }

                LoadDistrict();

                ddlDistrict.SelectedValue = memberMaster.DistrictId.ToString();

                if (memberMaster.IsApproved)
                {
                    ddlDistrict.Enabled = false;
                }

                LoadBlock();

                ddlBlock.SelectedValue = memberMaster.BlockId.ToString();

                if (memberMaster.IsApproved)
                {
                    ddlBlock.Enabled = false;
                }


                txtCompanyName.Text = memberMaster.CompanyName.ToString();
                ddlMembershipCategory.SelectedValue = memberMaster.CategoryId.ToString();
                //ddlMembershipCategory.Enabled = false;

                ddlMemberGroup.SelectedValue = memberMaster.MemberGroupId.ToString();
                //ddlMemberGroup.Enabled = false;
                ddlBusinessType.SelectedValue = memberMaster.BusinessTypeId.ToString();
                //ddlBusinessType.Enabled = false;

                txtMembershipDate.Text = memberMaster.MembershipDate.ToString("dd/MM/yyyy");
                txtEffectiveDate.Text  = memberMaster.EffectiveDate.ToString("dd/MM/yyyy");

                if (Session["UserType"].ToString().Equals("Admin"))
                {
                    txtMembershipDate.Enabled = true;
                    txtEffectiveDate.Enabled  = true;
                }
                else
                {
                    txtMembershipDate.Enabled = false;
                    txtEffectiveDate.Enabled  = false;
                }

                txtLayerCapacityNos.Text           = memberMaster.LayerCapacityNos.ToString();
                txtBroilerCapacityNos.Text         = memberMaster.BroilerCapacityNos.ToString();
                txtBreederCapacityNos.Text         = memberMaster.BreederCapacityNos.ToString();
                txtEggSellerDailySalesNos.Text     = memberMaster.EggSellerDailySalesNos.ToString();
                txtChickenSellerDailySalesNos.Text = memberMaster.ChickenSellerDailySalesNos.ToString();
                txtChickenSellerDailySalesKgs.Text = memberMaster.ChickenSellerDailySalesKgs.ToString();
                txtFeedProducerDailySalesMT.Text   = memberMaster.FeedProducerDailySalesMT.ToString();
                txtFeedSellerDailySalesMT.Text     = memberMaster.FeedSellerDailySalesMT.ToString();
                txtOtherCategory.Text = memberMaster.OtherCategory.ToString();
                txtRemarks.Text       = memberMaster.Remarks.ToString();
                txtWebsite.Text       = memberMaster.Website.ToString();
                ImgPhoto.ImageUrl     = (memberMaster.ImageName == string.Empty) ? "MemberPhoto/Male.jpg" : "MemberPhoto/" + memberMaster.ImageName;
                chkMember.Checked     = memberMaster.IsMember;
                chkMember.Enabled     = false;

                txtLayerCapacityNos.Enabled           = chkMember.Checked;
                txtBreederCapacityNos.Enabled         = chkMember.Checked;
                txtChickenSellerDailySalesNos.Enabled = chkMember.Checked;
                txtFeedProducerDailySalesMT.Enabled   = chkMember.Checked;
                txtBroilerCapacityNos.Enabled         = chkMember.Checked;
                txtEggSellerDailySalesNos.Enabled     = chkMember.Checked;
                txtChickenSellerDailySalesKgs.Enabled = chkMember.Checked;
                txtFeedSellerDailySalesMT.Enabled     = chkMember.Checked;
                txtOtherCategory.Enabled = chkMember.Checked;
                txtRemarks.Enabled       = chkMember.Checked;

                chkIsGovtMember.Checked = memberMaster.IsGovtMember;
                chkIsGovtMember.Enabled = false;

                if (memberMaster.MemberSMSCategoryId == 0)
                {
                    ddlMemberSMSCategory.SelectedIndex = 0;
                }
                else
                {
                    ddlMemberSMSCategory.SelectedValue = Convert.ToString(memberMaster.MemberSMSCategoryId);
                }

                txtMobileNo2.Text = memberMaster.MobileNo2;
                txtNarration.Text = memberMaster.Narration;
                txtMembershipCategoryEffectiveDate.Text = memberMaster.MembershipCategoryEffectiveDate.ToString("dd/MM/yyyy");
                chkExecutiveMember.Checked = memberMaster.IsExecutiveMember;

                Message.Show = false;
                btnSave.Text = "Update";
            }
        }