protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                LifeLineDbContext context = new LifeLineDbContext();

                int id = 0;
                int.TryParse(Convert.ToString(ViewState["Id"]), out id);

                if (id != 0)
                {
                    ModifyData(context, id);
                }
                else
                {
                    SaveData(context);
                }

                context.SaveChanges();
                ClearFields();
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #2
0
        private void GetData()
        {
            LifeLineDbContext context = new LifeLineDbContext();

            var list = (from a in context.Memos
                        join b in context.Consignee_Master on a.consigneeId equals b.consigneeId
                        select new {
                memoId = a.memoId,
                memoNumber = a.memoNumber,
                memoDate = a.memoDate,
                unloadingDate = a.unloadingDate,
                consigneeName = b.consigneeName,
                vehicleNo = a.vehicleNo,
                pickupLocation = a.pickupLocation,
                dropLocation = a.dropLocation,
                weight = a.weight,
                hireFixed = a.hireFixedAmt,
                advanceAmt = a.advanceAmt,
                balanceAmt = a.balanceAmt,
                balanceAt = a.balanceAt
            }).ToList();

            gvList.DataSource = list;
            gvList.DataBind();
        }
Example #3
0
        private void GetData(int id)
        {
            LifeLineDbContext context = new LifeLineDbContext();

            var com = context.Company_Master.First(x => x.companyId == id);

            ViewState["Id"] = com.companyId;

            txtCompanyName.Text    = com.companyName;
            txtSignType.Text       = com.signatoryType;
            txtTitle.Text          = com.title;
            txtAddress1.Text       = com.address1;
            txtAddress2.Text       = com.address2;
            txtArea.Text           = com.area;
            txtCity.Text           = com.city;
            ddlState.SelectedValue = Convert.ToString(com.stateId);
            txtPincode.Text        = com.pincode;
            txtPhoneNo.Text        = com.phoneNumber;
            txtMobileNo.Text       = com.mobileNumber;
            txtFaxNo.Text          = com.faxNumber;
            txtEmail.Text          = com.emailId;
            txtTaxSaleValue.Text   = Convert.ToString(com.taxSaleValue);
            txtVatNo.Text          = com.VatTinNo;
            txtCstNo.Text          = com.CstTinNo;
        }
Example #4
0
        private void SaveData(LifeLineDbContext context)
        {
            Company_Master obj = new Company_Master();

            obj.companyName   = txtCompanyName.Text.Trim();
            obj.signatoryType = txtSignType.Text.Trim();
            obj.title         = txtTitle.Text.Trim();
            obj.address1      = txtAddress1.Text.Trim();
            obj.address2      = txtAddress2.Text.Trim();
            obj.area          = txtArea.Text.Trim();
            obj.city          = txtCity.Text.Trim();
            obj.stateId       = ddlState.SelectedIndex == 0 ? null : (int?)Convert.ToInt32(ddlState.SelectedValue);
            obj.pincode       = txtPincode.Text.Trim();
            obj.phoneNumber   = txtPhoneNo.Text.Trim();
            obj.mobileNumber  = txtMobileNo.Text.Trim();
            obj.faxNumber     = txtFaxNo.Text.Trim();
            obj.emailId       = txtEmail.Text.Trim();
            obj.taxSaleValue  = string.IsNullOrWhiteSpace(txtTaxSaleValue.Text) ? null : (int?)Convert.ToDecimal(txtTaxSaleValue.Text);
            obj.VatTinNo      = txtVatNo.Text.Trim();
            obj.CstTinNo      = txtCstNo.Text.Trim();
            obj.entryBy       = SessionHelper.UserId;
            obj.entryDate     = DateTime.Now;
            obj.updatedOn     = null;

            context.AddToCompany_Master(obj);
        }
        private void GetData()
        {
            LifeLineDbContext context = new LifeLineDbContext();

            var listHeader = (from a in context.Invoice_Header
                              join b in context.Consignee_Master on a.consigneeId equals b.consigneeId
                              join c in context.Vehicle_Master on a.vehicleId equals c.vehicleId
                              select new
            {
                InvoiceId = a.invoiceId,
                InvoiceNo = a.invoiceNumber,
                InvoiceDate = a.invoiceDate,
                ConsigneeId = a.consigneeId,
                ConsigneeName = b.consigneeName,
                FromLocation = a.fromLocation,
                ToLocation = a.toLocation,
                VehicleId = a.vehicleId,
                VehicleNo = c.vehicleNo,
                TENNo = a.TENon,
                TotalAmount = a.totalAmount
            }).ToList();

            gvList.DataSource = listHeader;
            gvList.DataBind();
        }
        private void Bind_Combobox()
        {
            LifeLineDbContext context = new LifeLineDbContext();

            var states = from s in context.States
                         select new
            {
                s.StateId,
                s.StateName
            };

            ddlState.DataSource     = states.ToList();
            ddlState.DataTextField  = "StateName";
            ddlState.DataValueField = "StateId";
            ddlState.DataBind();
            ddlState.Items.Insert(0, new ListItem("--- Select State Name ---", "0"));


            context = new LifeLineDbContext();

            var com = (from a in context.Company_Master
                       select new
            {
                a.companyId,
                a.companyName
            });

            ddlCompany.DataSource     = com.ToList();
            ddlCompany.DataTextField  = "companyName";
            ddlCompany.DataValueField = "companyId";
            ddlCompany.DataBind();
            ddlCompany.Items.Insert(0, new ListItem("--- Select Company Name ---", "0"));
        }
        private void GetData()
        {
            LifeLineDbContext context = new LifeLineDbContext();

            var compList = (from emp in context.Employee_Master
                            join s in context.States on emp.stateId equals s.StateId into es
                            from cs in es.DefaultIfEmpty()
                            select new
            {
                employeeId = emp.employeeId,
                firstName = emp.firstName,
                middleName = emp.middleName,
                lastName = emp.lastName,
                mobileNo = emp.mobileNumber,
                phoneNo = emp.phoneNumber,
                emailId = emp.emailAddress,
                empAddress = emp.empAddress,
                city = emp.city,
                stateName = cs.StateName,
                pincode = emp.pincode,
                empStatus = emp.empStatus == "R" ? "Released" : "Working"
            }).ToList();

            gvList.DataSource = compList;
            gvList.DataBind();
        }
Example #8
0
        private void GetData(int id)
        {
            LifeLineDbContext context = new LifeLineDbContext();

            var com = context.Employee_Master.First(x => x.employeeId == id);

            ViewState["Id"] = com.employeeId;

            txtFirstName.Text      = com.firstName;
            txtMiddleName.Text     = com.middleName;
            txtLastName.Text       = com.lastName;
            txtAddress.Text        = com.empAddress;
            txtCity.Text           = com.city;
            ddlState.SelectedValue = Convert.ToString(com.stateId);
            txtPincode.Text        = com.pincode;
            txtPhone.Text          = com.phoneNumber;
            txtMobile.Text         = com.mobileNumber;
            txtEmail.Text          = com.emailAddress;

            if (com.empStatus == "R")
            {
                ddlEmpStatus.SelectedValue = Convert.ToString(com.empStatus);
                txtReleasedOn.Text         = Convert.ToDateTime(com.releasedOnDate).ToString("dd/MM/yyyy");
                divrelDate.Visible         = true;
            }
            else
            {
                ddlEmpStatus.SelectedValue = Convert.ToString(com.empStatus);
                txtReleasedOn.Text         = string.Empty;
                divrelDate.Visible         = false;
            }
        }
Example #9
0
        private void ModifyData(LifeLineDbContext context, int id)
        {
            var obj = context.Expense_Master.First(x => x.expenseId == id);

            obj.expenseName   = txtExpenseName.Text.Trim();
            obj.effectiveDate = DateTime.ParseExact(txtEffectiveDate.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            obj.entryBy       = SessionHelper.UserId;
            obj.updatedOn     = DateTime.Now;
        }
        private void GetData()
        {
            LifeLineDbContext context = new LifeLineDbContext();

            var compList = from comp in context.Consignor_Master
                           select comp;

            gvList.DataSource = compList;
            gvList.DataBind();
        }
        private void GetData()
        {
            LifeLineDbContext context = new LifeLineDbContext();

            var driver = (from d in context.Expense_Master
                          select d);

            gvList.DataSource = driver.ToList();
            gvList.DataBind();
        }
        private void GetData()
        {
            LifeLineDbContext context = new LifeLineDbContext();

            var vehicle = from vh in context.Vehicle_Master
                          select vh;

            gvList.DataSource = vehicle.ToList();
            gvList.DataBind();
        }
        private void GetData()
        {
            LifeLineDbContext context = new LifeLineDbContext();

            var userList = from user in context.User_Master
                           select user;

            gvList.DataSource = userList;
            gvList.DataBind();
        }
Example #14
0
        private void Autogenerate_MemoNo()
        {
            using (LifeLineDbContext context = new LifeLineDbContext())
            {
                int memoNo = context.Memos.Any() ? context.Memos.Max(m => m.memoNumber) : 0;

                memoNo = memoNo == 0 ? 1 : memoNo + 1;

                txtMemoNo.Text = memoNo.ToString();
            }
        }
Example #15
0
        private void GetData(int id)
        {
            LifeLineDbContext context = new LifeLineDbContext();

            var com = context.Expense_Master.First(x => x.expenseId == id);

            ViewState["Id"] = com.expenseId;

            txtExpenseName.Text   = com.expenseName;
            txtEffectiveDate.Text = Convert.ToDateTime(com.effectiveDate).ToString("dd/MM/yyyy");
        }
Example #16
0
        private void Autogenerate_MemoNo()
        {
            using (LifeLineDbContext context = new LifeLineDbContext())
            {
                int InvNo = context.Invoice_Header.Any() ? context.Invoice_Header.Max(m => m.invoiceNumber) : 0;

                InvNo = InvNo == 0 ? 1 : InvNo + 1;

                txtBillNo.Text = InvNo.ToString();
            }
        }
Example #17
0
        private void SaveData(LifeLineDbContext context)
        {
            Expense_Master obj = new Expense_Master();

            obj.expenseName   = txtExpenseName.Text.Trim();
            obj.effectiveDate = DateTime.ParseExact(txtEffectiveDate.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            obj.entryBy       = SessionHelper.UserId;
            obj.entryDate     = DateTime.Now;
            obj.updatedOn     = null;

            context.AddToExpense_Master(obj);
        }
        private void ModifyData(LifeLineDbContext context, int id)
        {
            var user = context.User_Master.First(x => x.userId == id);

            user.userName     = txtUserName.Text.Trim();
            user.loginId      = txtLoginId.Text.Trim();
            user.loginKey     = txtPasswd.Text.Trim();
            user.mobileNo     = txtMobileNo.Text.Trim();
            user.emailAddress = txtEmailId.Text.Trim();
            user.entryBy      = 1;
            user.updatedOn    = DateTime.Now;
        }
Example #19
0
 private void Bind_Combobox()
 {
     using (LifeLineDbContext context = new LifeLineDbContext())
     {
         var states = from s in context.States
                      select new
         {
             s.StateId,
             s.StateName
         };
     }
 }
Example #20
0
        private void ModifyData(LifeLineDbContext context, int id)
        {
            var obj = context.Vehicle_Master.First(x => x.vehicleId == id);

            obj.makerName        = txtMakerName.Text.Trim();
            obj.modelName        = txtModelName.Text.Trim();
            obj.vehicleNo        = txtVehicleNo.Text.Trim();
            obj.engineNo         = txtEngineNo.Text.Trim();
            obj.chasisNo         = txtChasisNo.Text.Trim();
            obj.yearManufactured = txtManufacYear.Text;
            obj.entryBy          = SessionHelper.UserId;
            obj.updatedOn        = DateTime.Now;
        }
        private void GetData(int id)
        {
            LifeLineDbContext context = new LifeLineDbContext();

            var user = context.User_Master.First(x => x.userId == id);

            ViewState["Id"]   = user.userId;
            txtUserName.Text  = user.userName;
            txtLoginId.Text   = user.loginId;
            txtPasswd.Text    = user.loginKey;
            txtConPasswd.Text = user.loginKey;
            txtMobileNo.Text  = user.mobileNo;
            txtEmailId.Text   = user.emailAddress;
        }
        private void ModifyData(LifeLineDbContext context, int id)
        {
            var obj = context.Branch_Master.First(x => x.branchId == id);

            obj.branchName    = txtBranchName.Text.Trim();
            obj.companyId     = Convert.ToInt32(ddlCompany.SelectedValue);
            obj.branchAddress = txtAddress1.Text.Trim();
            obj.city          = txtCity.Text.Trim();
            obj.stateId       = Convert.ToInt32(ddlState.SelectedValue);
            obj.pincode       = txtPincode.Text.Trim();
            obj.mobileNo      = txtMobileNo.Text.Trim();
            obj.phoneNo       = txtPhoneNo.Text.Trim();
            obj.entryBy       = SessionHelper.UserId;
            obj.updatedOn     = DateTime.Now;
        }
        private void SaveData(LifeLineDbContext context)
        {
            User_Master obj = new User_Master();

            obj.userName     = txtUserName.Text.Trim();
            obj.loginId      = txtLoginId.Text.Trim();
            obj.loginKey     = txtPasswd.Text.Trim();
            obj.mobileNo     = txtMobileNo.Text.Trim();
            obj.emailAddress = txtEmailId.Text.Trim();
            obj.entryBy      = SessionHelper.UserId;
            obj.entryDate    = DateTime.Now;
            obj.updatedOn    = null;

            context.AddToUser_Master(obj);
        }
Example #24
0
        private void GetData(int id)
        {
            LifeLineDbContext context = new LifeLineDbContext();

            var com = context.Vehicle_Master.First(x => x.vehicleId == id);

            ViewState["Id"] = com.vehicleId;

            txtMakerName.Text   = com.makerName;
            txtModelName.Text   = com.modelName;
            txtVehicleNo.Text   = com.vehicleNo;
            txtEngineNo.Text    = com.engineNo;
            txtChasisNo.Text    = com.chasisNo;
            txtManufacYear.Text = com.yearManufactured;
        }
        private void ModifyData(LifeLineDbContext context, int id)
        {
            var obj = context.Driver_Master.First(x => x.driverId == id);

            obj.driverName  = txtDriverName.Text.Trim();
            obj.dateOfBirth = DateTime.ParseExact(txtDOB.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            obj.address1    = txtAddress1.Text.Trim();
            obj.address2    = txtAddress2.Text.Trim();
            obj.city        = txtCity.Text.Trim();
            obj.stateId     = ddlState.SelectedIndex == 0 ? null : (int?)Convert.ToInt32(ddlState.SelectedValue);
            obj.mobileNo    = txtMobileNo.Text.Trim();
            obj.LicenseNo   = txtLicenseNo.Text.Trim();
            obj.entryBy     = SessionHelper.UserId;
            obj.updatedOn   = DateTime.Now;
        }
Example #26
0
        private void ModifyData(LifeLineDbContext context, long id)
        {
            var obj = context.Invoice_Header.First(x => x.invoiceId == id);

            obj.invoiceNumber = Convert.ToInt32(txtBillNo.Text);
            obj.invoiceDate   = DateTime.ParseExact(txtDate.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            obj.consigneeId   = Convert.ToInt32(hfConsigneeIdSave.Value);
            obj.vehicleId     = string.IsNullOrWhiteSpace(hfVehicleIdSave.Value) ? null : (int?)Convert.ToInt32(hfVehicleIdSave.Value);
            obj.fromLocation  = string.IsNullOrWhiteSpace(txtPickupLoc.Text) ? null : txtPickupLoc.Text;
            obj.toLocation    = string.IsNullOrWhiteSpace(txtDropLoc.Text) ? null : txtDropLoc.Text;
            obj.TENon         = string.IsNullOrWhiteSpace(txtTENno.Text) ? null : txtTENno.Text;
            obj.entryBy       = SessionHelper.UserId;
            obj.updatedOn     = DateTime.Now;

            context.SaveChanges();
        }
Example #27
0
        private void SaveData(LifeLineDbContext context)
        {
            Vehicle_Master obj = new Vehicle_Master();

            obj.makerName        = txtMakerName.Text.Trim();
            obj.modelName        = txtModelName.Text.Trim();
            obj.vehicleNo        = txtVehicleNo.Text.Trim();
            obj.engineNo         = txtEngineNo.Text.Trim();
            obj.chasisNo         = txtChasisNo.Text.Trim();
            obj.yearManufactured = txtManufacYear.Text;
            obj.entryBy          = SessionHelper.UserId;
            obj.entryDate        = DateTime.Now;
            obj.updatedOn        = null;

            context.AddToVehicle_Master(obj);
        }
        private void GetData(int id)
        {
            LifeLineDbContext context = new LifeLineDbContext();

            var com = context.Branch_Master.First(x => x.branchId == id);

            ViewState["Id"] = com.branchId;

            txtBranchName.Text       = com.branchName;
            ddlCompany.SelectedValue = Convert.ToString(com.companyId);
            txtAddress1.Text         = com.branchName;
            txtCity.Text             = com.city;
            ddlState.SelectedValue   = Convert.ToString(com.stateId);
            txtPincode.Text          = com.pincode;
            txtMobileNo.Text         = com.mobileNo;
            txtPhoneNo.Text          = com.phoneNo;
        }
        private void GetData(int id)
        {
            LifeLineDbContext context = new LifeLineDbContext();

            var com = context.Driver_Master.First(x => x.driverId == id);

            ViewState["Id"] = com.driverId;

            txtDriverName.Text     = com.driverName;
            txtDOB.Text            = Convert.ToDateTime(com.dateOfBirth).ToString("dd/MM/yyyy");
            txtAddress1.Text       = com.address1;
            txtAddress2.Text       = com.address2;
            txtCity.Text           = com.city;
            ddlState.SelectedValue = Convert.ToString(com.stateId);
            txtMobileNo.Text       = com.mobileNo;
            txtLicenseNo.Text      = com.LicenseNo;
        }
Example #30
0
        private void Bind_Combobox()
        {
            LifeLineDbContext context = new LifeLineDbContext();

            var states = from s in context.States
                         select new
            {
                s.StateId,
                s.StateName
            };

            ddlState.DataSource     = states.ToList();
            ddlState.DataTextField  = "StateName";
            ddlState.DataValueField = "StateId";
            ddlState.DataBind();
            ddlState.Items.Insert(0, new ListItem("--- Select State Name ---", "0"));
        }