Example #1
0
 protected void btnclose_Click(object sender, EventArgs e)
 {
     using (Entities1 db = new Entities1())
     {
         int    id     = Convert.ToInt32(Request.QueryString["Id"].ToString());
         string userId = User.Identity.GetUserId();
         db.usp_ComplaintsUpdateProcedure(
             id,
             Convert.ToInt32(drpapartmentnumber.Value),
             Convert.ToInt32(drplvl1.Value),
             Convert.ToInt32(drplvl2.Value),
             Convert.ToInt32(drplvl3.SelectedItem.Value),
             Convert.ToDateTime(txtfixdatetime.Text),
             DateTime.Now,
             null,
             3,
             null,
             drptechniction.Text,
             userId,
             memonotes.Text,
             txtsubject.Text
             , txtSearch.Text
             , txtphone.Text
             , txtcustomername.Text
             , Convert.ToInt32(drpownertype.SelectedItem.Value)
             , txtother.Text
             , drpotheap.Text
             );
         resultmessage.Attributes["class"] = "alert-success";
         lbltxtresult.Text = "تم اقفال البلاغ بنجاح";
         btnedit.Visible   = false;
         btnsumnit.Visible = false;
         DataBind();
     }
 }
Example #2
0
 protected void btnedit_Click(object sender, EventArgs e)
 {
     using (Entities1 db = new Entities1())
     {
         int    id     = Convert.ToInt32(Request.QueryString["Id"].ToString());
         string userId = User.Identity.GetUserId();
         db.usp_ComplaintsUpdateProcedure(
             id,
             Convert.ToInt32(drpapartmentnumber.Value),
             Convert.ToInt32(drplvl1.Value),
             Convert.ToInt32(drplvl2.Value),
             Convert.ToInt32(drplvl3.SelectedItem.Value),
             Convert.ToDateTime(txtfixdatetime.Text),
             DateTime.Now,
             Convert.ToInt32(drppaint.SelectedValue),
             (int)ComplaintStatusEnum.Investigation,
             Convert.ToInt32(drpissue.Value),
             txttechname.Text,
             userId,
             memonotes.Text,
             txtsubject.Text
             , txtSearch.Text
             , txtphone.Text
             , txtcustomername.Text
             , Convert.ToInt32(drpownertype.SelectedItem.Value)
             , txtother.Text
             , drpotheap.Text
             );
         resultmessage.Attributes["class"] = "alert-success";
         lbltxtresult.Text = "تم تعديل البلاغ بنجاح";
         DataBind();
     }
 }
Example #3
0
        protected void btnsbmit_Click(object sender, EventArgs e)
        {
            usp_NotificationMessagesInsertProcedure_Result notificationRecord = null;
            usp_ComplaintsUpdateProcedure_Result           complaintResult    = null;

            using (TransactionScope tx = new TransactionScope())
            {
                using (Entities1 db = new Entities1())
                {
                    int    id     = Convert.ToInt32(Request.QueryString["Id"].ToString());
                    string userId = User.Identity.GetUserId().ToString();
                    var    x      =
                        db.usp_ComplaintsUpdateProcedure(
                            id,
                            Convert.ToInt32(drpapartmentnumber.Value),
                            Convert.ToInt32(drplvl1.Value),
                            Convert.ToInt32(drplvl2.Value),
                            Convert.ToInt32(drplvl3.SelectedItem.Value),
                            Convert.ToDateTime(txtfixdatetime.Text),
                            DateTime.Now,
                            Convert.ToInt32(drppaint.SelectedValue),
                            (int)ComplaintStatusEnum.Completed,
                            Convert.ToInt32(drpissue.Value),
                            txttechname.Text,
                            userId,
                            memonotes.Text,
                            txtsubject.Text
                            , txtSearch.Text
                            , txtphone.Text
                            , txtcustomername.Text
                            , Convert.ToInt32(drpownertype.SelectedItem.Value)
                            , txtother.Text
                            , drpotheap.Text
                            );
                    complaintResult = x.FirstOrDefault();
                    resultmessage.Attributes["class"] = "alert-success";
                    lbltxtresult.Text = "تم الانتهاء من العمل في البلاغ";
                    btnedit.Visible   = false;
                    DataBind();
                    string messageText = string.Format(Utilities.GetDescription(NotificationMessagesEnum.ComplaintClosure), complaintResult.ID.ToString("9260000000"), ConfigurationManager.AppSettings["WebServerIP"] + "/Evaluation/TechnictionEvaluation?ID=" + complaintResult.ID);
                    ObjectResult <usp_NotificationMessagesInsertProcedure_Result> y =
                        db.usp_NotificationMessagesInsertProcedure(
                            "966" + complaintResult.Phone.TrimStart('0'),
                            complaintResult.ID.ToString("9260000000"),
                            messageText,
                            null,
                            1,
                            1,
                            DateTime.Now
                            );
                    notificationRecord = y.FirstOrDefault();
                }
                tx.Complete();
            }
            Utilities.SendSMS(notificationRecord.MobileNumber, notificationRecord.MessageText, notificationRecord.ID);
        }
Example #4
0
 protected void btnsbmit_Click(object sender, EventArgs e)
 {
     try
     {
         using (Entities1 db = new Entities1())
         {
             int    id     = Convert.ToInt32(Request.QueryString["Id"].ToString());
             string userId = User.Identity.GetUserId().ToString();
             db.usp_ComplaintsUpdateProcedure(
                 id,
                 Convert.ToInt32(drpapartmentnumber.Value),
                 Convert.ToInt32(drplvl1.Value),
                 Convert.ToInt32(drplvl2.Value),
                 Convert.ToInt32(drplvl3.SelectedItem.Value),
                 Convert.ToDateTime(txtfixdatetime.Text),
                 DateTime.Now,
                 null,
                 (int)ComplaintStatusEnum.Investigation,
                 null,
                 drptechniction.Text,
                 userId,
                 memonotes.Text,
                 txtsubject.Text
                 , txtSearch.Text
                 , txtphone.Text
                 , txtcustomername.Text
                 , Convert.ToInt32(drpownertype.SelectedItem.Value)
                 , txtother.Text
                 , drpotheap.Text
                 );
             resultmessage.Attributes["class"] = "alert-success";
             lbltxtresult.Text = "تم تحويل البلاغ الي عمليات ما بعد الكشف";
             btnedit.Visible   = false;
             btnclose.Visible  = false;
             DataBind();
         }
     }
     catch (Exception exception)
     {
         Log.Error(exception.StackTrace);
     }
 }