private void SetrddlType(int?type) { // VehicleType_ID VehicleType_Name //return ; if (type == null) { rddlType.SelectedIndex = -1; hiddenIndex = _khali; return; } for (int i = 0; i < DtModels.Rows.Count; i++) { if ((int)DtModels.Rows[i]["VehicleType_ID"] == type) { if (!(bool)DtModels.Rows[i]["VehicleType_Hidden"]) { rddlType.SelectedIndex = (int)DtModels.Rows[i]["VehicleType_DDLID"]; hiddenIndex = _khali; } else { rddlType.SelectedIndex = -1; rddlType.Text = (string)DtModels.Rows[i]["VehicleType_Name"]; hiddenIndex = (int)DtModels.Rows[i]["VehicleType_DDLID"]; } return; } } ItemsPublic.Exeptor("نوع خودرو یافت نشد"); }
private void SetModelsCar() { Models = null; Models = new OutputDatas(); Models = objManager.View_vehiclesType(null, null); if (!Models.success) { ItemsPublic.Exeptor("خطا در بازآوری اطلاعات انواع خودرو"); } }
private void radGridViewPersons_RowFormatting(object sender, RowFormattingEventArgs e) { try { if (!ItemsPublic.IsnewRowAdded && ItemsPublic.MyRights.Contains(ServerClasses.AllFunctions._Rights.View_persons)) { if (e != null) { if (e.RowElement != null) { if (!(e.RowElement is GridTableHeaderRowElement)) { if (e.RowElement.RowInfo.Cells["Person_ID"] != null) { if (e.RowElement.RowInfo.Cells["Person_HaveForm"] != null) { //var tempId = bool.Parse(e.RowElement.RowInfo.Cells["Person_IsBlackTemp"].Value.ToString()); //if(e.RowElement.RowInfo.Cells["Person_IsBlackTemp"]!=null) if (e.RowElement.RowInfo.Cells["Person_IsBlackTemp"] != null) { bool?tempIsBlack = (bool)e.RowElement.RowInfo.Cells["Person_IsBlackTemp"].Value; if (tempIsBlack == true) { e.RowElement.DrawFill = true; e.RowElement.BackColor = Color.PaleVioletRed; } else if (e.RowElement.RowInfo.Cells["Person_SecureFormDate"].Value == null || string.IsNullOrEmpty(e.RowElement.RowInfo.Cells["Person_SecureFormDate"].Value.ToString())) { // DateTime? dd = (DateTime?)e.RowElement.RowInfo.Cells["Person_SecureFormDate"].Value; e.RowElement.DrawFill = true; e.RowElement.BackColor = Color.PaleGoldenrod; } else { e.RowElement.DrawFill = true; e.RowElement.BackColor = Color.White; } } } } } } } } } catch (Exception ex) { //ItemsPublic.ShowMessage("رنگ نگاری ناقص"+ "\r\n"+ex.Message); ItemsPublic.Exeptor("رنگ نگاری ناقص" + "\r\n" + ex.Message); } }
private void frm_BaridForm_Load(object sender, EventArgs e) { unVisibleCbbEmpty(); myColSearchName = "BaridName"; mySource = ItemsPublic.AllUserBarid; if (mySource == null) { ItemsPublic.Exeptor("اطلاعاتی از اتوماسیون دریافت نشده"); } MainRadGridView.DataSource = mySource; }
private void SetMyRights(int?GroupId) { OutputDatas OD = objManager.View_rights(GroupId, null); if (OD.success) { uC_groupDetails1.RightsRadGridView.DataSource = OD.ResultTable; } else { ItemsPublic.Exeptor(OD.Message); } }
public void SetModelsCar() { Manager objManager2 = new Manager(); var Models = new OutputDatas(); DtModels = null; DtModels = new DataTable(); DtModels.Columns.Add("VehicleType_ID", typeof(int)); DtModels.Columns.Add("VehicleType_Name", typeof(string)); DtModels.Columns.Add("VehicleType_Desc", typeof(string)); DtModels.Columns.Add("VehicleType_Hidden", typeof(bool)); DtModels.Columns.Add("VehicleType_DDLID", typeof(int)); Models = objManager2.View_vehiclesType(null, null); if (!Models.success) { ItemsPublic.Exeptor("خطا در بازآوری اطلاعات انواع خودرو"); } //DtModels = Models.ResultTable.Copy(); int countNotHidden = -1; foreach (DataRow item in Models.ResultTable.Rows) { //countNotHidden++; DtModels.Rows.Add(); DtModels.Rows[DtModels.Rows.Count - 1]["VehicleType_ID"] = item["VehicleType_ID"]; DtModels.Rows[DtModels.Rows.Count - 1]["VehicleType_Name"] = item["VehicleType_Name"]; DtModels.Rows[DtModels.Rows.Count - 1]["VehicleType_Desc"] = item["VehicleType_Desc"]; DtModels.Rows[DtModels.Rows.Count - 1]["VehicleType_Hidden"] = item["VehicleType_Hidden"]; if (!(bool)item["VehicleType_Hidden"]) { countNotHidden++; DtModels.Rows[DtModels.Rows.Count - 1]["VehicleType_DDLID"] = countNotHidden; } else { DtModels.Rows[DtModels.Rows.Count - 1]["VehicleType_DDLID"] = _khali; } if (!(bool)item["VehicleType_Hidden"]) { rddlType.Items.Add((string)item["VehicleType_Name"]); } } //foreach (var row in Models.ResultTable.Rows) //for (int index = 0; index < DtModels.Rows.Count; index++) //{ //} // UC_vehicleDetails31.rddlType.DataSource = Models.ResultTable.Columns["VehicleType_Name"]; }
private int SetrddlConfirmer(int Operator_BaridId) { // VehicleType_ID VehicleType_Name for (int i = 0; i < ODConfirmer.ResultTable.Rows.Count; i++) { if ((int)ODConfirmer.ResultTable.Rows[i]["Operator_BaridId"] == Operator_BaridId) { return(i); } } ItemsPublic.Exeptor("اپراتور یافت نشد"); return(-1); }
private string FindParentName(int?parentId) { if (parentId != null) { for (int i = 0; i < DtOffice.Rows.Count; i++) { if ((int)DtOffice.Rows[i]["Office_ID"] == parentId) { return(DtOffice.Rows[i]["Office_Name"].ToString()); } } ItemsPublic.Exeptor(ItemsPublic._errParentDontFind); } // return(null); }
private int?findRealIndex(int ddlIndex) { if (ddlIndex < 0) { return(null); } foreach (DataRow item in DtModels.Rows) { if ((int)item["VehicleType_DDLID"] == ddlIndex) { return((int?)item["VehicleType_ID"]); } } ItemsPublic.Exeptor("نوع خودرو یافت نشد"); return(null); }
private void frm_BlockPerson_Load(object sender, EventArgs e) { if (currentIsBlack == true) { uC_BlackListDetails1.rgbBlackList.Text = "جهت عادی کردن وضعیت فرد انتخابی"; } else if (currentIsBlack == false) { uC_BlackListDetails1.rgbBlackList.Text = "جهت مسدود کردن فرد انتخابی"; } else { ItemsPublic.Exeptor("وضعیت جاری نا مشخص می باشد"); } uC_BlackListDetails1.SetAllTypeBLReasons(); OutputDatas result = new OutputDatas(); result = objManager.View_blackLists(currentPersonId); if (!result.success) { ItemsPublic.ShowMessage(result.Message); return; } radGridView1.DataSource = result.ResultTable; for (int i = 0; i < radGridView1.Rows.Count(); i++) { var str = radGridView1.Rows [i].Cells ["BlackList_DateTime"].Value.ToString().Trim(); var dtItem = DateTime.Parse(str); // MessageBox.Show ( result.ResultTable.Rows [i] ["BlackList_DateTime"].ToString() ); // MessageBox.Show ("item: "+ dtItem.ToString() ); radGridView1.Rows [i].Cells ["BlackList_dtFarsiLabel"].Value = ItemsPublic.GetPersianDate(dtItem); radGridView1.Rows[i].Cells["BlackList_isBalckLabel"].Value = ( bool )radGridView1.Rows [i].Cells ["BlackList_isBlack"].Value ? "مسدود" : "عادی"; //radGridView1.Rows[i].Cells["BLReason_Desc"].Value = } }
private void radGridViewAgreements_RowFormatting(object sender, RowFormattingEventArgs e) { try { if (!ItemsPublic.IsnewRowAdded && ItemsPublic.MyRights.Contains(ServerClasses.AllFunctions._Rights.View_agreements)) { if (e != null) { if (e.RowElement != null) { if (!(e.RowElement is GridTableHeaderRowElement)) { if (radGridViewAgreements != null) { if (e.RowElement.RowInfo != null) { if (e.RowElement.RowInfo.Cells["Agreement_EndDate"].Value != null) { bool isActive = true;; if (e.RowElement.RowInfo.Cells["Agreement_IsActive"].Value != null) { isActive = (bool)e.RowElement.RowInfo.Cells["Agreement_IsActive"].Value; } firstTimeRowFormat = DateTime.Now; endTimeRowFormat = (DateTime)e.RowElement.RowInfo.Cells["Agreement_EndDate"].Value; countDay = 1 + (int)endTimeRowFormat.Subtract(firstTimeRowFormat).TotalDays; if (countDay < 0 || !isActive) { e.RowElement.DrawFill = true; e.RowElement.BackColor = Color.LightGray; } else if (countDay < 5) { e.RowElement.DrawFill = true; e.RowElement.BackColor = Color.LightPink; } else if (countDay < 15) { e.RowElement.DrawFill = true; e.RowElement.BackColor = Color.Yellow; } else { e.RowElement.DrawFill = true; e.RowElement.BackColor = Color.White; } } } } } } } } } catch (Exception ex) { //ItemsPublic.ShowMessage("رنگ نگاری ناقص"+ "\r\n"+ex.Message); ItemsPublic.Exeptor("رنگ نگاری ناقص" + "\r\n" + ex.Message); } }
// Dictionary<int, string> comboBox1; public void Start() { try { //this.Visible = false; ItemsPublic.AcssesIsDenied = false; ItemsPublic.ConnectToServer = true; Customer customer = new Customer(); var input = new Dictionary <AllFunctions._IdData, object>(); input.Add(AllFunctions._IdData.Event_ComputerName, ItemsPublic.MyComputerName); input.Add(AllFunctions._IdData.Operator_BaridId, ItemsPublic.MyBaridId); input.Add(AllFunctions._IdData.Event_IpAddress, ItemsPublic.MyIpAddress); input.Add(AllFunctions._IdData.IdMethod, AllFunctions._IdMethod.View_offices); var result = new OutputDatas(); result = customer.Suit(Serialize.BinarySerialize(input)); if (result == null) { ItemsPublic.ConnectToServer = false; // this.Close(); return; } if (result.success) { dt = result.ResultTable; if (dt.Rows.Count == 1) { // comboBox1.Add((int)dt.Rows[0].ItemArray[0], dt.Rows[0].ItemArray[3].ToString()); // comboBox1.SelectedIndex = 0; // button1_Click(sender, e); Login((int)dt.Rows[0].ItemArray[0], dt.Rows[0].ItemArray[3].ToString()); } else if (dt.Rows.Count == 0) { ItemsPublic.AcssesIsDenied = true; // this.Close(); return; } else { // this.Visible = true; // comboBox1 = new Dictionary<int, string>(); frm_officeselector frm = new frm_officeselector(dt); frm.ShowDialog(); // int temp = frm.indexSelected; if (frm.indexSelected < 0) { ItemsPublic.Exeptor("اداره ای انتخاب نشده است"); } Login((int)dt.Rows[frm.indexSelected].ItemArray[0], dt.Rows[frm.indexSelected].ItemArray[3].ToString()); //foreach (DataRow item in dt.Rows) //{ // comboBox1.Items.Add(item.ItemArray[3].ToString()); //} //comboBox1.SelectedIndex = 0; } } else { ItemsPublic.AcssesIsDenied = true; ItemsPublic.ShowMessage(result.Message); // MessageBox.Show(result.Message); // this.Close(); } // ItemsPublic.ConnectToServer = true; } catch (Exception ex) { ItemsPublic.ShowMessage(ex.Message); // MessageBox.Show("عملیات لاگین به سامانه مجوز تردد با خطا مواجه شده است"); ItemsPublic.ConnectToServer = false; //this.Close(); } }