protected void pageSave(Object sender, BrilliantWMS.ToolbarService.iUCToolbarClient e) { CustomProfile profile = CustomProfile.GetProfile(); iCycleCountClient cycleclient = new iCycleCountClient(); tCycleCountHead cycleH = new tCycleCountHead(); DataSet ds = new DataSet(); if (hdnCycleheadID.Value != "") { cycleH.ID = long.Parse(hdnCycleheadID.Value); cycleH.Title = txtTitle.Text.ToString(); cycleH.Status = ddlstatus.SelectedItem.Text; cycleH.CountBasis = ddlcountbasis.SelectedItem.Text; cycleH.CycleCountDate = UC_FromDate.Date; cycleH.WarehouseID = long.Parse(hdnwarehouseId.Value); cycleH.Frequency = hdnfrequency.Value; cycleH.CreatedBy = profile.Personal.UserID; cycleH.CreationDate = DateTime.Now; cycleH.Active = "Yes"; if (rbtnActiveNo.Checked == true) { cycleH.Active = "No"; } ds = cycleclient.getCompanyCustomer(long.Parse(hdnwarehouseId.Value), profile.DBConnection._constr); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { cycleH.CompanyID = long.Parse(ds.Tables[0].Rows[0]["CompanyID"].ToString()); cycleH.CustomerID = long.Parse(ds.Tables[0].Rows[0]["CustomerID"].ToString()); } long CycleHeadID = cycleclient.SaveCycleCountHead(cycleH, profile.DBConnection._constr); WebMsgBox.MsgBox.Show("Record saved successfully"); clear(); BindCycleMainGrid(); Response.Redirect("CycleCount.aspx"); } }