/** * Constructor. * @param graph The automaton (DA) that contains this state. */ public DA_State(DA graph, int index) { _graph = graph; _edges = new EdgeContainerExplicit_APElement<DA_State>(graph.getAPSize()); Index = index; }
internal List <Notification> GetNotByTYPE(string type) { DA.SelectCommand.CommandText = "select A.*,B.IDS from " + Base.BaseName + "..NOTIFICATIONS A " + " left join " + Base.BaseName + "..SUMMON B on A.IDSUMMON = B.ID where IDNTYPE = " + type; DA.Fill(DS, "t"); List <Notification> ln = new List <Notification>(); foreach (DataRow r in DS.Tables["t"].Rows) { Notification n = new Notification(); //n.ID = r["ID"].ToString(); n.IDSUMMON = r["IDSUMMON"].ToString(); n.IDNTYPE = r["IDNTYPE"].ToString(); n.IDS = r["IDS"].ToString(); n.CREATED = (r["CREATED"] == DBNull.Value) ? DateTime.Now : (DateTime)r["CREATED"]; ln.Add(n); } return(ln); }
protected void Button_login_Click1(object sender, EventArgs e) { Session["Role_Admin"] = Session["Role_Member"] = Session["Role_DR"] = "False"; // اذا كان المدير if (DA.Check_User(TextBox_name.Text, TextBox_pass.Text).Rows.Count > 0) { FormsAuthentication.RedirectFromLoginPage(TextBox_name.Text, true); Session["Role_Admin"] = "True"; Label_msg.Text = "تم"; Response.Redirect("Admin/Default.aspx"); } else { Label_msg.Text = "اسم مستخدم أو كلمة مرور غير صحيحة"; } //اذا كان يوزر مسجل عادي if (DA.Check_member(TextBox_name.Text, TextBox_pass.Text).Rows.Count > 0) { FormsAuthentication.RedirectFromLoginPage(TextBox_name.Text, true); Session["Role_Member"] = "True"; Response.Redirect("Members/Default_Members.aspx"); } else { Label_msg.Text = "اسم مستخدم أو كلمة مرور غير صحيحة"; } // اذا كان من الدكاترة المختصين if (DA.Check_DR(TextBox_name.Text, TextBox_pass.Text).Rows.Count > 0) { FormsAuthentication.RedirectFromLoginPage(TextBox_name.Text, true); Session["Role_DR"] = "True"; Response.Redirect("Doctors/ActiveQ.aspx"); } else { Label_msg.Text = "اسم مستخدم أو كلمة مرور غير صحيحة"; } }
public object GetAllBooks() { DA.SelectCommand.CommandText = "select 1 ID, C.PLAIN collate cyrillic_general_ci_ai tit,D.PLAIN collate cyrillic_general_ci_ai avt," + " INV.SORT collate cyrillic_general_ci_ai inv, 'Центр Американской Культуры' fund, TEMAP.PLAIN tema, POLKAP.PLAIN polka " + " from BJACC..MAIN A" + " left join BJACC..DATAEXT CC on A.ID = CC.IDMAIN and CC.MNFIELD = 200 and CC.MSFIELD = '$a'" + " left join BJACC..DATAEXT DD on DD.ID = (select top 1 Z.ID from BJACC..DATAEXT Z where A.ID = Z.IDMAIN and Z.MNFIELD = 700 and Z.MSFIELD = '$a')" + " left join BJACC..DATAEXTPLAIN C on C.IDDATAEXT = CC.ID" + " left join BJACC..DATAEXTPLAIN D on D.IDDATAEXT = DD.ID" + " left join BJACC..DATAEXT INV on A.ID = INV.IDMAIN and INV.MNFIELD = 899 and INV.MSFIELD = '$w'" + " left join BJACC..DATAEXT klass on INV.IDDATA = klass.IDDATA and klass.MNFIELD = 921 and klass.MSFIELD = '$c' " + " left join BJACC..DATAEXT polka on INV.IDDATA = polka.IDDATA and polka.MNFIELD = 899 and polka.MSFIELD = '$c' " + " left join BJACC..DATAEXTPLAIN POLKAP on POLKAP.IDDATAEXT = polka.ID" + " left join BJACC..DATAEXT TEMA on A.ID = TEMA.IDMAIN and TEMA.MNFIELD = 922 and TEMA.MSFIELD = '$e'" + " left join BJACC..DATAEXTPLAIN TEMAP on TEMAP.IDDATAEXT = TEMA.ID" + " where INV.SORT is not null " +//and klass.SORT='Длявыдачи'" + " union all " + "select 1 ID,C.PLAIN collate cyrillic_general_ci_ai tit,D.PLAIN collate cyrillic_general_ci_ai avt," + " INV.SORT collate cyrillic_general_ci_ai inv, 'Основной фонд' fund , TEMAP.PLAIN tema, POLKAP.PLAIN polka " + " from BJVVV..MAIN A " + " left join BJVVV..DATAEXT CC on A.ID = CC.IDMAIN and CC.MNFIELD = 200 and CC.MSFIELD = '$a'" + " left join BJVVV..DATAEXT DD on DD.ID = (select top 1 Z.ID from BJVVV..DATAEXT Z where A.ID = Z.IDMAIN and Z.MNFIELD = 700 and Z.MSFIELD = '$a')" + " left join BJVVV..DATAEXTPLAIN C on C.IDDATAEXT = CC.ID" + " left join BJVVV..DATAEXTPLAIN D on D.IDDATAEXT = DD.ID" + " left join BJVVV..DATAEXT INV on A.ID = INV.IDMAIN and INV.MNFIELD = 899 and INV.MSFIELD = '$w'" + " left join BJVVV..DATAEXT klass on INV.IDDATA = klass.IDDATA and klass.MNFIELD = 921 and klass.MSFIELD = '$c' " + " left join BJVVV..DATAEXT polka on INV.IDDATA = polka.IDDATA and polka.MNFIELD = 899 and polka.MSFIELD = '$c' " + " left join BJVVV..DATAEXTPLAIN POLKAP on POLKAP.IDDATAEXT = polka.ID" + " left join BJVVV..DATAEXT TEMA on A.ID = TEMA.IDMAIN and TEMA.MNFIELD = 922 and TEMA.MSFIELD = '$e'" + " left join BJVVV..DATAEXTPLAIN TEMAP on TEMAP.IDDATAEXT = TEMA.ID" + " left join BJVVV..DATAEXT FF on INV.IDDATA = FF.IDDATA and FF.MNFIELD = 899 and FF.MSFIELD = '$a'" + " where INV.SORT is not null and FF.IDINLIST = 52 ";//and klass.SORT='Длявыдачи'"; //спросить какой класс издания для них считается нормальным DS = new DataSet(); DA.Fill(DS, "t"); return(DS.Tables["t"]); }
internal DataTable GetRemarksByIDWPDOC(string DOCUMENTNAME, string IDWP) { DA.SelectCommand.CommandText = "select A.ID,W.WPNAME+' '+W.DECNUM WP,IDWP,DOCUMENTNAME, REMARK," + " case when DOCUMENTNAME = 'COMPOSITION' then 'Состав изделия' else " + " case when DOCUMENTNAME = 'DIMENSIONALDRAWING' then 'Габаритный чертёж' else " + " case when DOCUMENTNAME = 'CONFIGURATION' then 'Конфигурация' else " + " case when DOCUMENTNAME = 'WIRINGDIAGRAM' then 'Схема электрическая' else " + " case when DOCUMENTNAME = 'TECHREQ' then 'Технические требования' else " + " case when DOCUMENTNAME = 'SBORKA3D' then 'Сборка 3Д' else " + " case when DOCUMENTNAME = 'MECHPARTS' then 'Проект механических деталей' else " + " case when DOCUMENTNAME = 'SHILDS' then 'Шильды' else " + " case when DOCUMENTNAME = 'PACKAGING' then 'Упаковка' else " + " case when DOCUMENTNAME = 'SOFTWARE' then 'Программное обеспечение' else DOCUMENTNAME end end end end end end end end end end DOCUMENTNAME_RUS" + " ,DATEREMARK,B.FIO creator,C.ROLENAME createrole, " + " case when CLOSED=1 then 'Отработано' else 'Открыто' end CLOSED,CLOSINGCOMMENT,DATECLOSE,D.FIO closer,E.ROLENAME closerole " + " from " + Base.BaseName + "..REMARKWP A" + " left join " + Base.BaseName + "..USERS B on A.IDCREATOR = B.ID " + " left join " + Base.BaseName + "..ROLES C on B.ROLE = C.ID " + " left join " + Base.BaseName + "..USERS D on A.IDCLOSER = D.ID " + " left join " + Base.BaseName + "..ROLES E on D.ROLE = E.ID " + " left join " + Base.BaseName + "..WPNAMELIST W on A.IDWP = W.ID" + " where IDWP = " + IDWP + " and DOCUMENTNAME='" + DOCUMENTNAME + "' and CLOSED = 0 "; int i = DA.Fill(DS, "t"); //if (i==0) return null; /*WP_RVO RVO = new WP_RVO(); * RVO.ID = DS.Tables["t"].Rows[0]["ID"].ToString(); * RVO.CLOSED = (bool)DS.Tables["t"].Rows[0]["CLOSED"]; * RVO.CLOSINGCOMMENT = DS.Tables["t"].Rows[0]["CLOSINGCOMMENT"].ToString(); * RVO.DATECLOSE = (DS.Tables["t"].Rows[0]["DATECLOSE"].GetType() == typeof(DBNull)) ? DateTime.Now : (DateTime)DS.Tables["t"].Rows[0]["DATECLOSE"]; * RVO.DATEREMARK = (DateTime)DS.Tables["t"].Rows[0]["DATEREMARK"]; * RVO.DOCUMENTNAME = DS.Tables["t"].Rows[0]["DOCUMENTNAME"].ToString(); * RVO.IDCLOSER = DS.Tables["t"].Rows[0]["IDCLOSER"].ToString(); * RVO.IDCREATOR = DS.Tables["t"].Rows[0]["IDCREATOR"].ToString(); * RVO.IDWP = DS.Tables["t"].Rows[0]["IDWP"].ToString(); * RVO.REMARK = DS.Tables["t"].Rows[0]["REMARK"].ToString(); * return RVO;*/ return(DS.Tables["t"]); }
/// <summary> /// Handles saving an edited <see cref="Expense"/> /// </summary> private static bool SaveEditExpense() { var reference = ExpenseEdit.ReferenceText.Text; var amount = ExpenseEdit.AmountNumeric.Value; if (string.IsNullOrEmpty(reference) || amount == decimal.Zero) { return(false); } var isRecurring = ExpenseEdit.RecurringCheckbox.Checked; if (isRecurring && string.IsNullOrEmpty(ExpenseEdit.IntervalText.Text)) { return(false); } if (ExpenseEdit.PayeeDropDown.SelectedIndex == -1) { return(false); } var editedExpense = new Expense { Id = EditExpense.Id, Payee = ListAccessHelper.PayeeList[ExpenseEdit.PayeeDropDown.SelectedIndex], Ref = reference, Amount = amount, IsRecurring = isRecurring, Interval = Convert.ToInt32(ExpenseEdit.IntervalText.Text), InitialPaidDate = DateTime.Parse(ExpenseEdit.InitialPaymentDateTime.Text), LastPaidDate = DateTime.Parse(ExpenseEdit.InitialPaymentDateTime.Text) > EditExpense.LastPaidDate ? DateTime.Parse(ExpenseEdit.InitialPaymentDateTime.Text) : EditExpense.LastPaidDate }; var index = ListAccessHelper.ExpenseList.IndexOf(editedExpense); DA.EditExpense(editedExpense, editedExpense.Id); ListAccessHelper.ExpenseList[index] = editedExpense; XmlDA.SaveXml(); return(true); }
internal CableVO GetCableVOByID(int ID) { DA.SelectCommand.Parameters.AddWithValue("ID", ID); DA.SelectCommand.CommandText = " select * from " + Base.BaseName + "..CABLELIST where ID = @ID "; DA.Fill(DS, "t"); DataRow r = DS.Tables["t"].Rows[0]; CableVO CVO = new CableVO(); CVO.ID = (int)r["ID"]; CVO.WPName = r["CABLENAME"].ToString(); CVO.IDCat = (int)r["IDCATEGORY"]; CVO.IDSubCat = (r["IDSUBCAT"] == DBNull.Value) ? 0 : (int)r["IDSUBCAT"]; CVO.DecNum = r["DECNUM"].ToString(); CVO.DIMENDRAWING = r["DIMENSIONALDRAWING"].ToString(); CVO.MECHPARTS = r["MECHPARTS"].ToString(); CVO.CONECTORS = r["CONNECTORS"].ToString(); CVO.CLENGTH = r["CLENGTH"].ToString(); CVO.NOTE = r["NOTE"].ToString(); CVO.WPType = WPTYPE.CABLELIST; return(CVO); }
private static void ProcessRO() { var list = DA.GetLeaseRO(Begin, End); List <PurchaseOrderInfo> poList = MakePOList(list); using (TransactionScope tran = new TransactionScope()) { foreach (var item in poList) { foreach (var poitem in item.POItems) { var settled = list.Where(p => p.ProductSysNo == poitem.ProductSysNo); foreach (var settleitem in settled) { DA.SettleLeaseRO(settleitem); } } } tran.Complete(); } }
public static List <string> GetSkippedCases() { string query = $"SELECT WO.Id, U.Name, Sc.Description, WO.BrandName, WO.ModelName FROM WorkOrder AS WO " + $"INNER JOIN Skippedcases AS Sc ON WO.Id=Sc.CaseId " + $"INNER JOIN Users AS U ON Sc.UserId=U.Id " + $"WHERE WO.Status='Skipped'"; DataTable dt = DA.GetDtFromDb(query); List <string> skipped = new List <string>(); foreach (DataRow dr in dt.Rows) { string temp = Convert.ToInt32(dr["Id"]) + ", " + dr["Name"].ToString() + ", " + dr["Description"].ToString() + ", " + dr["BrandName"].ToString() + " " + dr["ModelName"].ToString(); skipped.Add(temp); } return(skipped); }
// GET: Home public ActionResult Index() { try { Dictionary <string, DataTable> lstTables = new Dictionary <string, DataTable>(); DataTable allData = DA.ExecStoreProc("GetMoviesData"); List <DataTable> groupedData = allData.AsEnumerable().GroupBy(row => row.Field <string>("Genre")).Select(g => g.CopyToDataTable()).ToList(); for (int table = 0; table < groupedData.Count; table++) { string groupName = Convert.ToString(groupedData[table].Rows[0][3]); groupedData[table].Columns.Remove("Genre"); lstTables.Add(groupName, groupedData[table]); } return(View(lstTables)); } catch (Exception ex) { throw ex; } }
private void btnFill_Click(object sender, EventArgs e) { using (DA d1 = new DA(txtServer1.Text.Trim(), txtDB1.Text.Trim())) { if (!d1.Connected()) { MessageBox.Show(Messages.cDbConnFailed + " 1", Messages.cErr, MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } cmbFTID1.Items.Clear(); IDictionary <int, string> col = d1.GetListData("tblGreenFormTypeL", nameCol: "Description"); if (col != null) { foreach (var item in col) { cmbFTID1.Items.Add(item.Value); } } } }
public static bool agregarCita(CITAS citas) { try { SQLSentencia peticion = new SQLSentencia(); peticion.Peticion = @"EXEC SP_Insertar_Cita '" + citas.ID_Mascota + "','" + citas.ID_Consultorio + "','" + citas.ID_Motivo_Cita + "','" + citas.Fecha_Inicio.ToShortDateString().ToString() + "','" + citas.Hora_Inicio.ToString() + "','" + citas.Hora_Fin.ToString() + "','" + citas.ID_Estado + "'"; DA acceso = new DA(); return(acceso.ejecutarSentecia(peticion)); } catch (Exception ex) { throw ex; } }
internal object GetOprReport(DateTime dateTime, DateTime dateTime_2, int p) { DA.SelectCommand.Parameters.Clear(); DA.SelectCommand.Parameters.AddWithValue("start", dateTime.Date); DA.SelectCommand.Parameters.AddWithValue("end", dateTime_2.Date); DA.SelectCommand.CommandText = " select count(A.DATEACTION) from Reservation_R..ISSUED_SCC_ACTIONS A " + " left join Reservation_R..ACTIONSTYPE B on A.IDACTION = B.ID " + " where cast(cast(A.DATEACTION as varchar(11)) as datetime) between @start and @end and A.IDACTION in (1,6) and A.IDEMP = " + p; DS = new DataSet(); int i = DA.Fill(DS, "rep1"); DS.Tables.Add("result"); DS.Tables["result"].Columns.Add("num"); DS.Tables["result"].Columns.Add("name"); DS.Tables["result"].Columns.Add("kolvo"); DS.Tables["result"].Rows.Add(new string[] { "1", "Количество выданных книг", DS.Tables["rep1"].Rows[0][0].ToString() }); DA.SelectCommand.Parameters.Clear(); DA.SelectCommand.Parameters.AddWithValue("start", dateTime.Date); DA.SelectCommand.Parameters.AddWithValue("end", dateTime_2.Date); DA.SelectCommand.CommandText = " select count(A.DATEACTION) from Reservation_R..ISSUED_SCC_ACTIONS A " + " left join Reservation_R..ACTIONSTYPE B on A.IDACTION = B.ID " + " where cast(cast(A.DATEACTION as varchar(11)) as datetime) between @start and @end and A.IDACTION = 2 and A.IDEMP = " + p; //DS = new DataSet(); i = DA.Fill(DS, "rep2"); DS.Tables["result"].Rows.Add(new string[] { "2", "Количество принятых книг", DS.Tables["rep2"].Rows[0][0].ToString() }); DA.SelectCommand.Parameters.Clear(); DA.SelectCommand.Parameters.AddWithValue("start", dateTime.Date); DA.SelectCommand.Parameters.AddWithValue("end", dateTime_2.Date); DA.SelectCommand.CommandText = " select count(distinct C.IDREADER) from Reservation_R..ISSUED_SCC_ACTIONS A " + " left join Reservation_R..ACTIONSTYPE B on A.IDACTION = B.ID " + " left join Reservation_R..ISSUED_SCC C on A.IDISSUED_SCC = C.ID " + " where cast(cast(A.DATEACTION as varchar(11)) as datetime) between @start and @end and A.IDACTION in (1,6) and A.IDEMP = " + p; //DS = new DataSet(); i = DA.Fill(DS, "rep3"); DS.Tables["result"].Rows.Add(new string[] { "3", "Количество читателей, получивших книги", DS.Tables["rep3"].Rows[0][0].ToString() }); return(DS.Tables["result"]); }
public object GetViolators() { //DA.SelectCommand.CommandText = "with vio as (select distinct 1 nn,A.IDREADER,B.FamilyName,B.[Name],B.FatherName," + // " (case when (B.Email is null or B.Email = '') then 'false' else 'true' end) isemail," + // " case when EM.DATEACTION is null then 'email не отправлялся' else CONVERT (NVARCHAR, EM.DATEACTION, 104) end emailsent " + // " from Reservation_R..ISSUED_ACC A" + // " left join Readers..Main B on A.IDREADER = B.NumberReader" + // " left join Reservation_R..ISSUED_ACC_ACTIONS EM on EM.IDISSUED_ACC = A.IDREADER and EM.IDACTION = 4" + // 4 - это ACTIONTYPE = сотрудник отослал емаил // " where A.IDSTATUS = 1 and A.DATE_RETURN < getdate() and "+ // " (EM.DATEACTION = (select max(DATEACTION) from Reservation_R..ISSUED_ACC_ACTIONS where IDISSUED_ACC = A.IDREADER and IDACTION = 4) " + // " or EM.DATEACTION is null) )" + // " select * from vio"; DA.SelectCommand.CommandText = " select distinct rm.NumberReader, " + "isnull(rm.FamilyName,'') +' '+isnull(rm.Name,'')+' '+isnull(rm.FatherName,'') fio , " + "rm.NumberReader numr, " + " Reservation_R.dbo.GetReaderRights(A.IDREADER) rgt, " + "(case when A.BaseId = 1 then isnull(PinvACC.PLAIN, PbarACC.PLAIN) else PinvVVV.PLAIN end) inv," + "isnull('факт.: '+rm.LiveTelephone+',','') + ' ' + isnull('дом.:'+rm.RegistrationTelephone+',','') ph, " + "isnull('факт.: '+rm.Email+',','') em ," + " 'Зарегистрирован: '+ isnull(rm.RegistrationProvince,'') + ', '+isnull(rm.RegistrationCity,'')+', '+isnull(rm.RegistrationStreet,'')+ '; ' + " + " 'Проживает: ' +isnull(rm.LiveProvince,'') + ', '+isnull(rm.LiveCity,'')+ ', '+isnull(rm.LiveStreet,'') address ," + " A.DATE_ISSUE , " + " A.DATE_RETURN ret," + " case when datediff(day, A.DATE_RETURN, getdate() ) < 0 then 0 else datediff(day, A.DATE_RETURN, getdate()) end ovrd " + " from Reservation_R..ISSUED_ACC A" + //" inner join BJVVV..LIST_8 DEP on A.ZALISS = DEP.SHORTNAME" + " left join Readers..Main rm on A.IDREADER = rm.NumberReader " + " left join BJVVV..LIST_8 l8 on l8.ID = rm.WorkDepartment " + " left join BJACC..DATAEXT invACC on invACC.IDDATA = A.IDDATA and invACC.MNFIELD = 899 and invACC.MSFIELD = '$p' and A.BaseId = 1 " + " left join BJACC..DATAEXTPLAIN PinvACC on invACC.ID = PinvACC.IDDATAEXT" + " left join BJACC..DATAEXT barACC on barACC.IDDATA = A.IDDATA and barACC.MNFIELD = 899 and barACC.MSFIELD = '$w' and A.BaseId = 1 " + " left join BJACC..DATAEXTPLAIN PbarACC on barACC.ID = PbarACC.IDDATAEXT" + " left join BJVVV..DATAEXT invVVV on invVVV.IDDATA = A.IDDATA and invVVV.MNFIELD = 899 and invVVV.MSFIELD = '$p' and A.BaseId = 2 " + " left join BJVVV..DATAEXTPLAIN PinvVVV on invVVV.ID = PinvVVV.IDDATAEXT" + " where A.IDSTATUS = 1 and A.DATE_RETURN < getdate() "; DS = new DataSet(); DA.Fill(DS, "t"); return(DS.Tables["t"]); }
public static bool AgregarNotaPruebas(PRUEBAS_PARTICIPANTES P_pruebap) { try { SQLSentencia objpeticion = new SQLSentencia(); //Ajustar peticion para utilización con parametros objpeticion.Peticion = @"EXEC SP_AGREGAR_PRUEBAS_PARTICIPANTES @ID_Pruebas, @ID_Participantes, @Nota"; //Crear los parametros SqlParameter parametroIdPruebas = new SqlParameter(); parametroIdPruebas.ParameterName = "@ID_Pruebas"; parametroIdPruebas.SqlDbType = System.Data.SqlDbType.Int; parametroIdPruebas.Value = P_pruebap.ID_Pruebas; SqlParameter parametroIdParticipantes = new SqlParameter(); parametroIdParticipantes.ParameterName = "@ID_Participantes"; parametroIdParticipantes.SqlDbType = System.Data.SqlDbType.Int; parametroIdParticipantes.Value = P_pruebap.ID_Participantes; SqlParameter parametroNota = new SqlParameter(); parametroNota.Value = P_pruebap.Nota; parametroNota.ParameterName = "@Nota"; parametroNota.SqlDbType = System.Data.SqlDbType.Int; //Agrega a la lista de parametros los parametros creados objpeticion.lstParametros.Add(parametroIdPruebas); objpeticion.lstParametros.Add(parametroIdParticipantes); objpeticion.lstParametros.Add(parametroNota); DA objacceso = new DA(); return(objacceso.ejecutarSentecia(objpeticion)); } catch (Exception ex) { throw ex; } }
/// <summary> /// Handles adding a new <see cref="Payer"/> /// </summary> private static bool AddNewPayer() { var name = PayersAdd.NameText.Text; var paymentType = PayersAdd.PaymentTypeText.Text; if (string.IsNullOrEmpty(name) || string.IsNullOrEmpty(paymentType)) { return(false); } var payer = new Payer { Id = Guid.NewGuid(), Name = name, PaymentType = paymentType }; DA.InsertPayer(payer); ListAccessHelper.PayerList.Add(payer); XmlDA.SaveXml(); return(true); }
//public bool Exists(string BAR) //{ // DA.SelectCommand.CommandText = "select top 1 IDMAIN from BJSCC..DATAEXT where MNFIELD = 899 and MSFIELD = '$w' and SORT = '" + BAR + "'"; // DS = new DataSet(); // int i = DA.Fill(DS, "t"); // if (i > 0) return true; else return false; //} internal bool IsIssued(int IDDATA, Bases fund) { if (fund == Bases.BJSCC) { DA.SelectCommand.CommandText = "select IDMAIN from Reservation_R..ISSUED_SCC where IDDATA = " + IDDATA + " and IDSTATUS in (1,6) and BaseId = 1"; } else { DA.SelectCommand.CommandText = "select IDMAIN from Reservation_R..ISSUED_SCC where IDDATA = " + IDDATA + " and IDSTATUS in (1,6) and BaseId = 2"; } DS = new DataSet(); int i = DA.Fill(DS, "t"); if (i > 0) { return(true); } else { return(false); } }
internal int GetIDISSUED(int IDDATA, Bases fund) { if (fund == Bases.BJSCC) { DA.SelectCommand.CommandText = "select ID from Reservation_R..ISSUED_SCC where IDDATA = " + IDDATA + " and IDSTATUS in (1,6) and BaseId = 1"; } else { DA.SelectCommand.CommandText = "select ID from Reservation_R..ISSUED_SCC where IDDATA = " + IDDATA + " and IDSTATUS in (1,6) and BaseId = 2"; } DS = new DataSet(); int i = DA.Fill(DS, "t"); if (i > 0) { return((int)DS.Tables["t"].Rows[0]["ID"]); } else { return(0); } }
public static bool ModificarPersonal(PERSONAL P_persona) { try { SQLSentencia objpeticion = new SQLSentencia(); objpeticion.Peticion = @"UPDATE PERSONAL SET Cedula = '" + P_persona.Cedula + "', Nombre = '" + P_persona.Nombre + "', Apellido_1 = '" + P_persona.Apellido_1 + "', Apellido_2 = '" + P_persona.Apellido_2 + "', Salario_Hora = '" + P_persona.Salario_Hora + "', Salario_Mensual = '" + P_persona.Salario_Mensual + "', Fecha_Contratacion = '" + P_persona.Fecha_Contratacion + "', Estado = '" + P_persona.Estado + "', Direccion = '" + P_persona.Direccion + "', Correo_Electronico = '" + P_persona.Correo_Electronico + "', Telefono = '" + P_persona.Telefono + "' WHERE ID_Puesto = '" + P_persona.ID_Puesto + "'"; DA objacceso = new DA(); return(objacceso.ejecutarSentecia(objpeticion)); } catch (Exception ex) { throw ex; } }
public static bool modificarCitas(CITAS cita) { try { SQLSentencia peticion = new SQLSentencia(); peticion.Peticion = @"EXEC SP_Modidicar_Cita '" + cita.ID_Cita + "','" + cita.ID_Mascota + "','" + cita.ID_Consultorio + "','" + cita.ID_Motivo_Cita + "','" + cita.Fecha_Inicio + "','" + cita.Hora_Inicio + "','" + cita.Hora_Fin + "','" + cita.Estado + "'"; DA acceso = new DA(); return(acceso.ejecutarSentecia(peticion)); } catch (Exception ex) { throw ex; } }
protected void Page_Load(object sender, EventArgs e) { Title = "اضافة أو تعديل سؤال"; Label_username.Text = Context.User.Identity.Name; DataTable DT = DA.GET_USERID(Label_username.Text); Label_userid.Text = DT.Rows[0]["user_Id"].ToString(); if (!IsPostBack) { // احضار البيانات من الداتا بيز if (Request.QueryString["Id"] != null) { DataTable DT1 = DA.GET_Question(Request.QueryString["Id"].ToString()); TextBox_Qtitle.Text = DT1.Rows[0]["Q_title"].ToString(); TextBox_Qcontent.Text = DT1.Rows[0]["Q_content"].ToString(); Button_add.Text = "تعديل"; } } }
public static bool ModificarPostulantes(PARTICIPANTES P_postulantes) { try { SQLSentencia objpeticion = new SQLSentencia(); objpeticion.Peticion = @"UPDATE PARTICIPANTES SET Cedula_ = '" + P_postulantes.Cedula_ + "', Nombre = '" + P_postulantes.Nombre + "', Apellido_1 = '" + P_postulantes.Apellido_1 + "', Apellido_2 = '" + P_postulantes.Apellido_2 + "', Correo = '" + P_postulantes.Correo + "', Telefono = '" + P_postulantes.Telefono + "', ID_Provincia = '" + P_postulantes.ID_Provincia + "', ID_Canton = '" + P_postulantes.ID_Canton + "', ID_Distrito = '" + P_postulantes.ID_Distrito + "', Direccion = '" + P_postulantes.Direccion + "', Estado = '" + P_postulantes.Estado + "' WHERE ID_Reclutamiento = '" + P_postulantes.ID_Reclutamiento + "'"; DA objacceso = new DA(); return(objacceso.ejecutarSentecia(objpeticion)); } catch (Exception ex) { throw ex; } }
public List <BJRecord> GetBookByBAR(string BAR) { DA.SelectCommand.CommandText = "select A.*,B.PLAIN from BJSCC..DATAEXT A " + " left join BJSCC..DATAEXTPLAIN B on A.ID = B.IDDATAEXT " + " where A.IDMAIN = (select top 1 IDMAIN from BJSCC..DATAEXT where MNFIELD = 899 and MSFIELD = '$w' and SORT = '" + BAR + "')"; DS = new DataSet(); int i = DA.Fill(DS, "t"); Bases fund = Bases.BJSCC; if (i == 0) { DA.SelectCommand.CommandText = "select A.*,B.PLAIN from BJVVV..DATAEXT A " + " left join BJVVV..DATAEXTPLAIN B on A.ID = B.IDDATAEXT " + " where A.IDMAIN = (select top 1 IDMAIN from BJVVV..DATAEXT where MNFIELD = 899 and MSFIELD = '$w' and SORT = '" + BAR + "')"; fund = Bases.BJVVV; } DS = new DataSet(); i = DA.Fill(DS, "t"); List <BJRecord> Book = new List <BJRecord>(); BJRecord rec; foreach (DataRow r in DS.Tables["t"].Rows) { rec = new BJRecord(); rec.ID = (int)r["ID"]; rec.IDDATA = (int)r["IDDATA"]; rec.IDINLIST = (int)r["IDINLIST"]; rec.IDMAIN = (int)r["IDMAIN"]; rec.MNFIELD = (int)r["MNFIELD"]; rec.MSFIELD = r["MSFIELD"].ToString(); rec.PLAIN = r["PLAIN"].ToString(); rec.SORT = r["SORT"].ToString(); rec.Fund = fund; Book.Add(rec); } return(Book); }
public DataTable GetCategoryZhgutList(int IDCAT, int IDSUBCAT) { if (IDCAT == 15) { return(this.GetAllZhguts()); } string sub = new DBSubCategory().GetNameByID(IDSUBCAT); if (sub.ToUpper() == "ВСЕ") { DA.SelectCommand.CommandText = "select A.ID,A.ZHGUTNAME,B.CATEGORYNAME,isnull(C.SUBCATNAME,'НЕ ПРИСВОЕНО') SUBCATNAME,A.DECNUM,A.ZHGUTPATH,A.NOTE from " + Base.BaseName + "..ZHGUTLIST A " + " left join " + Base.BaseName + "..CATEGORYLIST B on B.ID = IDCATEGORY " + " left join " + Base.BaseName + "..SUBCATEGORYLIST C on C.ID = A.IDSUBCAT " + " where A.IDCATEGORY = " + IDCAT + " order by ZHGUTNAME"; } else if (sub.ToUpper() == "НЕ ПРИСВОЕНО") { DA.SelectCommand.CommandText = "select A.ID,A.ZHGUTNAME,B.CATEGORYNAME,isnull(C.SUBCATNAME,'НЕ ПРИСВОЕНО') SUBCATNAME,A.DECNUM,A.ZHGUTPATH,A.NOTE from " + Base.BaseName + "..ZHGUTLIST A " + " left join " + Base.BaseName + "..CATEGORYLIST B on B.ID = IDCATEGORY " + " left join " + Base.BaseName + "..SUBCATEGORYLIST C on C.ID = A.IDSUBCAT " + " where A.IDCATEGORY = " + IDCAT + " and ((A.IDSUBCAT is null) or (C.SUBCATNAME = 'НЕ ПРИСВОЕНО')) order by ZHGUTNAME"; } else { DA.SelectCommand.CommandText = "select A.ID,A.ZHGUTNAME,B.CATEGORYNAME,isnull(C.SUBCATNAME,'НЕ ПРИСВОЕНО') SUBCATNAME,A.DECNUM,A.ZHGUTPATH,A.NOTE from " + Base.BaseName + "..ZHGUTLIST A " + " left join " + Base.BaseName + "..CATEGORYLIST B on B.ID = IDCATEGORY " + " left join " + Base.BaseName + "..SUBCATEGORYLIST C on C.ID = A.IDSUBCAT " + " where A.IDCATEGORY = " + IDCAT + " and (A.IDSUBCAT = " + IDSUBCAT + ") order by ZHGUTNAME"; } DS = new DataSet(); int h = DA.Fill(DS, "t"); return(DS.Tables["t"]); }
protected void Page_Load(object sender, EventArgs e) { Title = "لوحة التحكم: اضافة وتعديل مقال"; if (!IsPostBack) { // احضار البيانات من الداتا بيز if (Request.QueryString["Id"] != null) { DataTable DT = DA.GETART(Request.QueryString["Id"].ToString()); Txt_Title.Text = DT.Rows[0]["title"].ToString(); Txt_des.Text = DT.Rows[0]["description"].ToString(); Txt_detail.Text = DT.Rows[0]["details"].ToString(); DropDownList_Section.SelectedValue = DT.Rows[0]["Sec_Id"].ToString(); if (Convert.ToBoolean(DT.Rows[0]["is_main"])) { RBL_Show.SelectedIndex = 0; } else if (Convert.ToBoolean(DT.Rows[0]["in_home"])) { RBL_Show.SelectedIndex = 1; } else if (Convert.ToBoolean(DT.Rows[0]["is_other"])) { RBL_Show.SelectedIndex = 2; } else { RBL_Show.SelectedIndex = -1; } Image1.Visible = true; Image1.ImageUrl = "~/GetImageFromDB.aspx?w=120&Id=" + Request.QueryString["Id"]; Button_Add.Text = "تعديل"; } } }
public ProcessResult BillingProcessStep3([FromBody] BillingProcessStep3Command model) { if (model.Period == default(DateTime)) { throw new Exception("Missing parameter: Period"); } using (DA.StartUnitOfWork()) { var result = new BillingProcessResult("BillingProcessStep3"); if ((model.BillingCategory & BillingCategory.Tool) > 0) { result.AddResult(new BillingProcessResult("PopulateToolBillingByOrg") { RowsLoaded = BillingDataProcessStep3.PopulateToolBillingByOrg(model.Period, model.ClientID) }); } if ((model.BillingCategory & BillingCategory.Room) > 0) { result.AddResult(new BillingProcessResult("PopulateRoomBillingByOrg") { RowsLoaded = BillingDataProcessStep3.PopulateRoomBillingByOrg(model.Period, model.ClientID) }); } if ((model.BillingCategory & BillingCategory.Room) > 0) { result.AddResult(new BillingProcessResult("PopulateStoreBillingByOrg") { RowsLoaded = BillingDataProcessStep3.PopulateStoreBillingByOrg(model.Period) }); } return(result); } }
internal object GetAllOverdueBook() { DA.SelectCommand.CommandText = "select distinct 1,C.PLAIN collate Cyrillic_general_ci_ai tit,D.PLAIN collate Cyrillic_general_ci_ai avt,A.IDREADER,B.FamilyName,B.[Name],B.FatherName," + " INV.SORT collate Cyrillic_general_ci_ai inv,A.DATE_ISSUE,A.DATE_RETURN," + " (case when (B.Email is null or B.Email = '') then 'false' else 'true' end) isemail," + " case when EM.DATEACTION is null then 'email не отправлялся' else CONVERT (NVARCHAR, EM.DATEACTION, 104) end emailsent, E.PLAIN collate Cyrillic_general_ci_ai shifr,'ЦСК' fund " + " from Reservation_R..ISSUED_SCC A" + " left join Readers..Main B on A.IDREADER = B.NumberReader" + " left join BJSCC..DATAEXT CC on A.IDMAIN = CC.IDMAIN and CC.MNFIELD = 200 and CC.MSFIELD = '$a'" + " left join BJSCC..DATAEXT DD on A.IDMAIN = DD.IDMAIN and DD.MNFIELD = 700 and DD.MSFIELD = '$a'" + " left join BJSCC..DATAEXT EE on A.IDDATA = EE.IDDATA and EE.MNFIELD = 899 and EE.MSFIELD = '$j'" + " left join BJSCC..DATAEXTPLAIN C on C.IDDATAEXT = CC.ID" + " left join BJSCC..DATAEXTPLAIN D on D.IDDATAEXT = DD.ID" + " left join BJSCC..DATAEXTPLAIN E on E.IDDATAEXT = EE.ID" + " left join Reservation_R..ISSUED_SCC_ACTIONS EM on EM.IDISSUED_SCC = A.IDREADER and EM.IDACTION = 4" + // 4 - это ACTIONTYPE = сотрудник отослал емаил " and EM.ID = (select max(z.ID) from Reservation_R..ISSUED_SCC_ACTIONS z where z.IDISSUED_SCC = A.IDREADER and z.IDACTION = 4)" + " left join BJSCC..DATAEXT INV on A.IDDATA = INV.IDDATA and INV.MNFIELD = 899 and INV.MSFIELD = '$w'" + " where A.IDSTATUS in (1,6) and A.BaseId = 1 and A.DATE_RETURN < getdate() " + " union all " + " select distinct 1,C.PLAIN collate Cyrillic_general_ci_ai tit,D.PLAIN collate Cyrillic_general_ci_ai avt,A.IDREADER,B.FamilyName,B.[Name],B.FatherName," + " INV.SORT collate Cyrillic_general_ci_ai inv,A.DATE_ISSUE,A.DATE_RETURN," + " (case when (B.Email is null or B.Email = '') then 'false' else 'true' end) isemail," + " case when EM.DATEACTION is null then 'email не отправлялся' else CONVERT (NVARCHAR, EM.DATEACTION, 104) end emailsent, E.PLAIN collate Cyrillic_general_ci_ai shifr,'ОФ' fund " + " from Reservation_R..ISSUED_SCC A" + " left join Readers..Main B on A.IDREADER = B.NumberReader" + " left join BJVVV..DATAEXT CC on A.IDMAIN = CC.IDMAIN and CC.MNFIELD = 200 and CC.MSFIELD = '$a'" + " left join BJVVV..DATAEXT DD on A.IDMAIN = DD.IDMAIN and DD.MNFIELD = 700 and DD.MSFIELD = '$a'" + " left join BJVVV..DATAEXT EE on A.IDDATA = EE.IDDATA and EE.MNFIELD = 899 and EE.MSFIELD = '$j'" + " left join BJVVV..DATAEXTPLAIN C on C.IDDATAEXT = CC.ID" + " left join BJVVV..DATAEXTPLAIN D on D.IDDATAEXT = DD.ID" + " left join BJVVV..DATAEXTPLAIN E on E.IDDATAEXT = EE.ID" + " left join Reservation_R..ISSUED_SCC_ACTIONS EM on EM.IDISSUED_SCC = A.IDREADER and EM.IDACTION = 4" + // 4 - это ACTIONTYPE = сотрудник отослал емаил " left join BJVVV..DATAEXT INV on A.IDDATA = INV.IDDATA and INV.MNFIELD = 899 and INV.MSFIELD = '$w'" + " where A.IDSTATUS in (1,6) and A.BaseId = 2 and A.DATE_RETURN < getdate()"; DS = new DataSet(); DA.Fill(DS, "t"); return(DS.Tables["t"]); }
public DBPreferences(int UID) { DA.SelectCommand.CommandText = "select * from " + Base.BaseName + "..PREFERENCES where IDUSER = "******"t") == 0) { int color = new ColorSelectControl().panel1.BackColor.ToArgb(); int rtime = 10 * (60000);//10 minutes in miliseconds DA.InsertCommand.CommandText = "insert into " + Base.BaseName + "..PREFERENCES (IDUSER,REFRESHTIME,COLOR) " + " values (" + UID + "," + rtime + "," + color + ")"; DA.InsertCommand.Connection.Open(); DA.InsertCommand.ExecuteNonQuery(); DA.InsertCommand.Connection.Close(); this.RefreshTime = rtime; this.NoteColor = color; } else { this.RefreshTime = (int)DS.Tables["t"].Rows[0]["REFRESHTIME"]; this.NoteColor = (int)DS.Tables["t"].Rows[0]["COLOR"]; } }
public override void PlayerJoinEvent(IcPlayer player) { PlayerClass Player = PlayersDatabase.GetPlayer(player.PlayerName); if (Player != null) { if (!DisableList.Contains(Player.Sound.ToLower())) { if (Player.Delay < MinDelay && Player.Delay > MaxDelay) { DA.PrivateColorMessage(player, Color.Cyan, $"[Join Sounds] Server settings are changed and incompatible setting detected. Your delay has been reset to minimum. Please update your delay with \"{CmdTriggers.Split('|')[0]} delay\"."); Player.Delay = MinDelay; PlayersDatabase.Update(player.PlayerName, Player); } StartTimer(player.PlayerId, FloatToTime(Player.Delay), false, new KeyValuePair <IcPlayer, PlayerClass>(player, Player)); } else { DA.PrivateColorMessage(player, Color.Cyan, $"[Join Sounds] Server settings are changed and incompatible setting detected. Your join sound is no longer available. Please update your sound with \"{CmdTriggers.Split('|')[0]} set\". Your join sound is removed."); PlayersDatabase.Remove(player.PlayerName); } } }
internal SummonRVO GetRemarkByID(string id) { DA.SelectCommand.CommandText = "select * from " + Base.BaseName + "..REMARKSUMMON where ID = " + id; int i = DA.Fill(DS, "t"); if (i == 0) { return(null); } SummonRVO RVO = new SummonRVO(); RVO.ID = id; RVO.CLOSED = (bool)DS.Tables["t"].Rows[0]["CLOSED"]; RVO.CLOSINGCOMMENT = DS.Tables["t"].Rows[0]["CLOSINGCOMMENT"].ToString(); RVO.DATECLOSE = (DS.Tables["t"].Rows[0]["DATECLOSE"].GetType() == typeof(DBNull)) ? DateTime.Now : (DateTime)DS.Tables["t"].Rows[0]["DATECLOSE"]; RVO.DATEREMARK = (DateTime)DS.Tables["t"].Rows[0]["DATEREMARK"]; RVO.DOCUMENTNAME = DS.Tables["t"].Rows[0]["DOCUMENTNAME"].ToString(); RVO.IDCLOSER = DS.Tables["t"].Rows[0]["IDCLOSER"].ToString(); RVO.IDCREATOR = DS.Tables["t"].Rows[0]["IDCREATOR"].ToString(); RVO.IDSUMMON = DS.Tables["t"].Rows[0]["IDSUMMON"].ToString(); RVO.REMARK = DS.Tables["t"].Rows[0]["REMARK"].ToString(); return(RVO); }
/// <summary> /// Handles deleting an <see cref="Income"/> record /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public static void DeleteIncome(object sender, EventArgs e) { try { var selectedListItems = IncomeView.IncomeListView.SelectedItems; if (selectedListItems.Count > 0) { var selectedItem = selectedListItems[0]; var incomeId = Guid.Parse(selectedItem.SubItems[0].Text); var income = ListAccessHelper.FindIncome(incomeId); ListAccessHelper.IncomeList.Remove(income); XmlDA.SaveXml(); DA.DeleteIncome(incomeId); PopulateListView(); } } catch (Exception ex) { ErrorHelper.SendError(ex); } }
/** * Perform the stuttered conversion. * Throws LimitReachedException if a limit is set (>0) and * there are more states in the generated DRA than the limit. * @param algo the underlying algorithm to be used * @param da_result the DRA where the result is stored * (has to have same APSet as the nba) * @param limit a limit for the number of states (0 disables the limit). */ public void convert(DAUnionAlgorithm algo, DA da_result, int limit) { StutteredConvertorUnion conv = new StutteredConvertorUnion(algo, da_result as DRA, limit, _detailed_states, _stutter_information); conv.convert(); }