public void Refresh() { MasterDataHelper.FetchProductData(); }
public void Refresh() { MasterDataHelper.FetchHofData(); }
public void Assign(DataSet ds) { MasterDataHelper.AssignProductClassData(ds); }
public void Refresh() { MasterDataHelper.FetchConfig(); }
public void Assign(DataSet ds) { MasterDataHelper.AssignProductBrandData(ds); }
public void Assign(DataSet ds) { MasterDataHelper.AssignProductSubDeptData(ds); }
public static void Refresh(string distId = "") { MasterDataHelper.FetchConfig(distId); _configs = MasterData.Configs.Data; }
public void Assign(DataSet ds) { MasterDataHelper.AssignDistributorData(ds); }
public void Refresh() { MasterDataHelper.FetchCardsOfThisFortnight(); }
public void Assign(DataSet ds) { MasterDataHelper.AssignCardsOfThisFortnight(ds); }
public void Assign(DataSet ds) { MasterDataHelper.AssignCategoryData(ds); }
public void Refresh() { MasterDataHelper.FetchCategoryWiseSearchResult(); }
public void Assign(DataSet ds) { MasterDataHelper.FetchCategoryWiseSearchResult(); }
public void Assign(DataSet ds) { MasterDataHelper.AssignHofData(ds); }
public static void AddOrEditConfig(string distId, string keyText, string keyVal) { MasterDataHelper.FetchConfig(distId, keyText, keyVal, 1, "ADDOREDIT"); }
public void Refresh() { MasterDataHelper.FetchDistributorData(); }
public static void DeleteConfig(string distId, string keyText) { MasterDataHelper.FetchConfig(distId, keyText, "", 0, "DELETE"); }
public void Refresh() { MasterDataHelper.FetchBrandData(); }
public static void CloneConfig(string distId, string cloneFromDistId) { MasterDataHelper.FetchConfig(distId, "", "", 1, "CLONE", cloneFromDistId); }
public void Refresh() { MasterDataHelper.FetchSubDeptData(); }
public void Refresh() { MasterDataHelper.FetchRelationData(); }
public void Refresh() { MasterDataHelper.FetchClassData(); }
public void Assign(DataSet ds) { MasterDataHelper.AssignRelationData(ds); }
private void txtRationcardNumber_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { try { CategoryWiseSearchResult searchedCards = MasterDataHelper.SearchCard("RATIONCARD", txtRationcardNumber.Text, null); if (searchedCards != null) { List <RationCardDetail> cardWithRationThisFortnight = searchedCards.CardSearchResult.FindAll(i => MasterData.AllCardsOfThisFortnight.Data.Any(j => j.Equals(i.Number))); if ((cardWithRationThisFortnight != null) && (cardWithRationThisFortnight.Count > 0)) { MessageBox.Show("RationCard already given in this Fortnight for below cards :" + Environment.NewLine + string.Join(Environment.NewLine , cardWithRationThisFortnight.Select(i => "Name : " + i.Name + " CardNumber : " + i.Number).ToList())); } searchedCards.CardSearchResult.RemoveAll(i => cardWithRationThisFortnight.Any(j => j.Number.Equals(i.Number))); searchedCards.CardCountOfCategory = searchedCards.CardSearchResult.Count; _searchedCards.Clear(); foreach (RationCardDetail card in searchedCards.CardSearchResult) { if (card.ActiveCard) { var cardExtended = new RationCardDetailExtended(); cardExtended = AutomapperHelper.ConvertAutoMapper <RationCardDetail, RationCardDetailExtended>(card); cardExtended.IsSelected = true; _searchedCards.Add(cardExtended); } } } grdVwSearchResult.DataSource = null; grdVwSearchResult.DataSource = _searchedCards; //making card number complete //var searchedCardNumber = _searchedCards.FirstOrDefault(i => i.Number.Contains(txtRationcardNumber.Text)).Number; txtRationcardNumber.Text = ""; //make unneccesary fileds hidden grdVwSearchResult.Columns["Cat_Key"].Visible = false; grdVwSearchResult.Columns["Cat_Desc"].Visible = false; grdVwSearchResult.Columns["RationCard_Id"].Visible = false; grdVwSearchResult.Columns["Card_Category_Id"].Visible = false; grdVwSearchResult.Columns["Customer_Created_Date"].Visible = false; grdVwSearchResult.Columns["Customer_Id"].Visible = false; grdVwSearchResult.Columns["Hof_Id"].Visible = false; grdVwSearchResult.Columns["Dist_Id"].Visible = false; grdVwSearchResult.Columns["ActiveCustomer"].Visible = false; grdVwSearchResult.Columns["Cat_Id"].Visible = false; //grdVwSearchResult.Columns["CardCount"].Visible = false; //grdVwSearchResult.Columns["FamilyCount"].Visible = false; grdVwSearchResult.Columns["ActiveCard"].Visible = true; //grdVwSearchResult.Columns["Hof_Flag"].Visible = false; grdVwSearchResult.Columns["CardStatus"].Visible = false; grdVwSearchResult.Columns["Gaurdian_Relation"].Visible = false; grdVwSearchResult.Columns["SlNo"].Visible = false; //grdVwSearchResult.Columns["Number"].Visible = false; grdVwSearchResult.Columns["Adhar_No"].Visible = false; //grdVwSearchResult.Columns["Mobile_No"].Visible = false; grdVwSearchResult.Columns["Hof_Name"].Visible = false; grdVwSearchResult.Columns["Relation_With_Hof"].Visible = false; //grdVwSearchResult.Columns["Name"].Visible = false; grdVwSearchResult.Columns["Age"].Visible = false; grdVwSearchResult.Columns["Address"].Visible = false; grdVwSearchResult.Columns["Card_Created_Date"].Visible = false; grdVwSearchResult.Columns["Gaurdian_Name"].Visible = false; grdVwSearchResult.Columns["Remarks"].Visible = false; grdVwSearchResult.Columns["FamilyCount"].Visible = false; grdVwSearchResult.Columns["CardCount"].Visible = false; grdVwSearchResult.Columns["IsSelected"].HeaderText = ""; grdVwSearchResult.Columns["IsSelected"].DisplayIndex = 0; grdVwSearchResult.Columns["IsSelected"].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; grdVwSearchResult.Columns["IsSelected"].GetPreferredWidth(DataGridViewAutoSizeColumnMode.AllCells, true); grdVwSearchResult.Columns["Number"].HeaderText = "Card No."; grdVwSearchResult.Columns["Number"].DisplayIndex = 1; grdVwSearchResult.Columns["Number"].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; grdVwSearchResult.Columns["Number"].GetPreferredWidth(DataGridViewAutoSizeColumnMode.AllCells, true); grdVwSearchResult.Columns["Name"].DisplayIndex = 2; grdVwSearchResult.Columns["Name"].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; grdVwSearchResult.Columns["Name"].GetPreferredWidth(DataGridViewAutoSizeColumnMode.AllCells, true); grdVwSearchResult.Columns["Mobile_No"].HeaderText = "Mobile No"; grdVwSearchResult.Columns["Mobile_No"].DisplayIndex = 3; grdVwSearchResult.Columns["Mobile_No"].AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells; grdVwSearchResult.Columns["Mobile_No"].GetPreferredWidth(DataGridViewAutoSizeColumnMode.AllCells, true); grdVwSearchResult.Columns["Hof_Flag"].HeaderText = "IsHof"; grdVwSearchResult.Columns["Hof_Flag"].DisplayIndex = 6; grdVwSearchResult.Columns["Hof_Flag"].AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader; grdVwSearchResult.Columns["Hof_Flag"].GetPreferredWidth(DataGridViewAutoSizeColumnMode.ColumnHeader, true); grdVwSearchResult.Columns["ActiveCard"].HeaderText = "Is Active"; grdVwSearchResult.Columns["ActiveCard"].DisplayIndex = 7; grdVwSearchResult.Columns["ActiveCard"].AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader; grdVwSearchResult.Columns["ActiveCard"].GetPreferredWidth(DataGridViewAutoSizeColumnMode.ColumnHeader, true); //grdVwSearchResult.Columns.Add(new DataGridViewColumn { ValueType = typeof(bool), Name = "IsSelected", HeaderText = "Select"}); //grdVwSearchResult.Width = grdVwSearchResult.Columns.GetColumnsWidth(DataGridViewElementStates.Visible) + 40; //grdVwSearchResult.Height = grdVwSearchResult.Rows.GetRowsHeight(new DataGridViewElementStates()); btnCreateBill.Visible = true; txtRationcardNumber.Text = ""; CalculateCardCount(); grdVwSearchResult.Focus(); } catch (Exception ex) { txtRationcardNumber.Text = ""; Logger.LogError(ex); } } }
public static List <Product> ProductSearch(string barCode, string articleCode, string prdName, string description, bool isActive, bool isDefaultToGiveRation , bool isDefaultPrd, string dept, string subDept, string prdClass, string subClass, string mc, string mcCode, string brand , string brandCompany, string dtFrom, string dtTo) { ErrorEnum errType = ErrorEnum.Other; string errMsg = string.Empty; bool isSuccess = false; List <Product> prds = new List <Product>(); try { List <SqlParameter> sqlParams = new List <SqlParameter>(); sqlParams.Add(new SqlParameter { ParameterName = "@distId", SqlDbType = SqlDbType.VarChar, Value = User.DistId }); sqlParams.Add(new SqlParameter { ParameterName = "@barCode", SqlDbType = SqlDbType.VarChar, Value = barCode }); sqlParams.Add(new SqlParameter { ParameterName = "@articleCode", SqlDbType = SqlDbType.VarChar, Value = articleCode }); sqlParams.Add(new SqlParameter { ParameterName = "@prdName", SqlDbType = SqlDbType.VarChar, Value = prdName }); sqlParams.Add(new SqlParameter { ParameterName = "@description", SqlDbType = SqlDbType.VarChar, Value = description }); sqlParams.Add(new SqlParameter { ParameterName = "@isActive", SqlDbType = SqlDbType.Bit, Value = isActive }); sqlParams.Add(new SqlParameter { ParameterName = "@isDefaultToGiveRation", SqlDbType = SqlDbType.Bit, Value = isDefaultToGiveRation }); sqlParams.Add(new SqlParameter { ParameterName = "@isDefaultPrd", SqlDbType = SqlDbType.Bit, Value = isDefaultPrd }); sqlParams.Add(new SqlParameter { ParameterName = "@dept", SqlDbType = SqlDbType.VarChar, Value = dept }); sqlParams.Add(new SqlParameter { ParameterName = "@subDept", SqlDbType = SqlDbType.VarChar, Value = subDept }); sqlParams.Add(new SqlParameter { ParameterName = "@class", SqlDbType = SqlDbType.VarChar, Value = prdClass }); sqlParams.Add(new SqlParameter { ParameterName = "@subClass", SqlDbType = SqlDbType.VarChar, Value = subClass }); sqlParams.Add(new SqlParameter { ParameterName = "@mc", SqlDbType = SqlDbType.VarChar, Value = mc }); sqlParams.Add(new SqlParameter { ParameterName = "@mcCode", SqlDbType = SqlDbType.VarChar, Value = mcCode }); sqlParams.Add(new SqlParameter { ParameterName = "@brand", SqlDbType = SqlDbType.VarChar, Value = brand }); sqlParams.Add(new SqlParameter { ParameterName = "@brandCompany", SqlDbType = SqlDbType.VarChar, Value = brandCompany }); sqlParams.Add(new SqlParameter { ParameterName = "@dtFrom", SqlDbType = SqlDbType.DateTime, Value = dtFrom }); sqlParams.Add(new SqlParameter { ParameterName = "@dtTo", SqlDbType = SqlDbType.DateTime, Value = dtTo }); DataSet ds = ConnectionManager.Exec("Sp_Product_Search", sqlParams, out errType, out errMsg, out isSuccess); if ((ds != null) && (ds.Tables.Count > 1) && (ds.Tables[0].Rows.Count > 0)) { DataSet tmpDs = new DataSet(); tmpDs.Tables.Add(ds.Tables[0].Copy()); tmpDs.Tables.Add(ds.Tables[1].Copy()); tmpDs.Tables.Add(ds.Tables[2].Copy()); tmpDs.Tables.Add(ds.Tables[3].Copy()); prds = MasterDataHelper.ExtractProductFromDataset(tmpDs); tmpDs.Reset(); } } catch (Exception ex) { Logger.LogError(ex); } return(prds); }
public void Assign(DataSet ds) { MasterDataHelper.AssignConfigData(ds); }
public static void ApplicationStartDbFetch(out ErrorEnum errType, out string errMsg, out bool isSuccess) { errType = ErrorEnum.Other; errMsg = string.Empty; isSuccess = false; string macAddr = Network.GetActiveMACAddress(); string ipAddrInternal = Network.GetActiveIP(); string ipAddrPublic = Network.GetPublicIpAddress(); string gateWay = Network.GetActiveGateway(); try { Logger.LogInfo("Mac id: " + macAddr + " ipAddr: " + ipAddrInternal + " Gateway: " + gateWay + "Public Ip: " + ipAddrPublic); List <SqlParameter> sqlParams = new List <SqlParameter>(); sqlParams.Add(new SqlParameter { ParameterName = "@mac", SqlDbType = SqlDbType.VarChar, Value = macAddr }); sqlParams.Add(new SqlParameter { ParameterName = "@Internal_Ip", SqlDbType = SqlDbType.VarChar, Value = ipAddrInternal }); sqlParams.Add(new SqlParameter { ParameterName = "@Public_Ip", SqlDbType = SqlDbType.VarChar, Value = ipAddrPublic }); sqlParams.Add(new SqlParameter { ParameterName = "@Gateway_Addr", SqlDbType = SqlDbType.VarChar, Value = gateWay }); DataSet ds = ConnectionManager.Exec("SP_App_Start", sqlParams, out errType, out errMsg, out isSuccess); if (isSuccess && ((ds != null) && (ds.Tables.Count > 0) && (ds.Tables[0].Rows.Count > 0) && (ds.Tables[0].Rows[0]["Status"].ToString() == "SUCCESS"))) { DataSet tmpDs = new DataSet(); tmpDs.Tables.Add(ds.Tables[1].Copy()); MasterDataHelper.AssignRoleData(tmpDs); tmpDs.Reset(); User.LoginId = ds.Tables[0].Rows[0]["Dist_Login"].ToString(); User.EmailId = ds.Tables[0].Rows[0]["Dist_Email"].ToString(); User.MacId = Network.GetActiveMACAddress(); User.AllowedMacId = ds.Tables[0].Rows[0]["Dist_Mac_Id"].ToString(); User.Name = ds.Tables[0].Rows[0]["Dist_Name"].ToString(); User.MobileNo = ds.Tables[0].Rows[0]["Dist_Mobile_No"].ToString(); User.DistId = ds.Tables[0].Rows[0]["Dist_Id"].ToString(); User.Address = ds.Tables[0].Rows[0]["Dist_Address"].ToString(); User.ProfilePicPath = ds.Tables[0].Rows[0]["Dist_Profile_Pic_Path"].ToString(); User.Roles = MasterData.Roles.Data; User.LiscenceNo = ds.Tables[0].Rows[0]["Dist_Fps_Liscence_No"].ToString(); User.MrShopNo = ds.Tables[0].Rows[0]["Dist_Mr_Shop_No"].ToString(); User.FpsCode = ds.Tables[0].Rows[0]["Dist_Fps_Code"].ToString(); User.IsSuperadmin = ds.Tables[0].Rows[0]["IsSuperAdmin"].ToString() == "True"; User.Password = ds.Tables[0].Rows[0]["Dist_Password"].ToString(); User.MobileNoToNotifyViaSms = ((ds.Tables[0].Rows[0]["MobileNoToNotifyViaSms"].ToString() != "0") ? ds.Tables[0].Rows[0]["MobileNoToNotifyViaSms"].ToString() : ""); User.EmailToNotify = ds.Tables[0].Rows[0]["EmailToNotify"].ToString(); Logger.LogInfo("LoginId: " + User.LoginId + " EmailId: " + User.EmailId + " MacId: " + User.MacId + " AllowedMacId: " + User.AllowedMacId + " Name: " + User.Name + " MobileNo: " + User.MobileNo + " DistId: " + User.DistId + " Address: " + User.Address + " ProfilePicPath: " + User.ProfilePicPath + " Role Count: " + User.Roles.Count + " LiscenceNo: " + User.LiscenceNo + " MrShopNo: " + User.MrShopNo + " FpsCode: " + User.FpsCode); isSuccess = true; } } catch (Exception ex) { errType = ErrorEnum.Other; Logger.LogError(ex); } }