Exemplo n.º 1
0
        public ActionResult User_login(User_Login_form user_login)
        {
            try
            {
                if (ModelState.IsValid)
                {

                    DataTable dt = user_login.User_Login_data(user_login);
                    if (dt.Rows.Count == 0)
                    {
                        ModelState.AddModelError("", "you Mobile number is not registerd.plz register first to avail this service");
                    }
                    else
                    {
                        user_complain_reg reg = new user_complain_reg();
                        DataTable dt1 = reg.User_detail(user_login);
                        reg.CA_NO = dt.Rows[0]["CA_NO"].ToString();
                        ISUService service = new ISUService();
                        DataSet ds = new DataSet();
                        ds = service.Z_BAPI_CMS_ISU_CA_DISPLAY("000" + reg.CA_NO, "", "", "", "", "");
                        if (ds.Tables[0].Rows.Count == 0)
                        {
                            ModelState.AddModelError("", "Please Check your CA number.");
                        }
                        else
                        {
                            reg.Address = ds.Tables[0].Rows[0]["House_Number"].ToString() + " " + ds.Tables[0].Rows[0]["Street"].ToString() + " " + ds.Tables[0].Rows[0]["Street2"].ToString() + " " + ds.Tables[0].Rows[0]["Street3"].ToString() + " " + ds.Tables[0].Rows[0]["Street4"].ToString() + ", " + ds.Tables[0].Rows[0]["City"].ToString() + ", PostCode: " + ds.Tables[0].Rows[0]["Post_Code"].ToString() + " .";
                            reg.Consumer_name = ds.Tables[0].Rows[0]["Bp_Name"].ToString();
                            reg.Mob = user_login.Mobile;
                            return RedirectToAction("user_complain_reg", reg);
                        }
                    }
                }
            }
            catch
            {
                ModelState.AddModelError("", "There is some problem in updation,plz try later");
            }
            return View();
        }
Exemplo n.º 2
0
 public static string User_Web_comp_reg(user_complain_reg user_complain, string[] detail)
 {
     StringBuilder sd = new StringBuilder();
     sd.Append(" insert into OMS_NC_IN(CA_NO,CALLER_NAME,CONSUMER_NAME,CONSUMER_NO,ADDRESS,TYPE_OF_FAULT,COMP_REASON,COMP_OPEN_BY,POLE_ID,EQUIPMENT_ID,COMPANY,CIRCLE,DIVISION,SUB_DIVISION,SUB_STATION,COMP_CENTER)values('" + user_complain.CA_NO + "','" + user_complain.Consumer_name + "','" + user_complain.Consumer_name + "' ");
     sd.Append(" ,'" + user_complain.Mob + "','" + user_complain.Address + "'," + user_complain.typeoffault + ",'" + user_complain.Remark + "','Web_comp','" + detail[0] + "','" + detail[1] + "','" + detail[2] + "','" + detail[3] + "','" + detail[4] + "','" + detail[5] + "','" + detail[6] + "'," + detail[7] + " ) ");
     return sd.ToString();
 }
Exemplo n.º 3
0
 public void User_comp_clear(user_complain_reg reg)
 {
     reg.Mob = 0;
     reg.Remark = "";
     reg.Address = "";
     reg.CA_NO = "";
     reg.Consumer_name = "";
 }
Exemplo n.º 4
0
        public ActionResult User_complain_reg(user_complain_reg reg)
        {
            try
            {

                if (ModelState.IsValid)
                {
                    string CA_NO = reg.CA_NO.ToString();
                    DataTable dt = reg.User_prev_comp_status(CA_NO);
                    if (dt.Rows.Count != 0)
                    {
                        ModelState.AddModelError("", "Your Complain is already registered.Your Complain number is '" + dt.Rows[0]["COMP_NO"].ToString() + "' ");
                    }
                    else
                    {
                        get_LT_network_detail LT_Network = new get_LT_network_detail();
                        string[] detail = new string[10];
                        DataTable dt1 = LT_Network.get_network_detail(CA_NO);
                        String Sub_station_code = dt1.Rows[0]["Substion_id"].ToString();
                        Service1 gis_service = new Service1();
                        DataSet ds = new DataSet();
                        ds = gis_service._Substation_Div_details(Sub_station_code);
                        detail[0] = dt1.Rows[0]["POLE_NO"].ToString();
                        detail[1] = dt1.Rows[0]["DT_CODE"].ToString();
                        detail[2] = ds.Tables[0].Rows[0]["Company"].ToString();
                        detail[3] = ds.Tables[0].Rows[0]["Circle"].ToString();
                        detail[4] = ds.Tables[0].Rows[0]["DIVISION_1"].ToString();
                        detail[5] = ds.Tables[0].Rows[0]["SUBDIVISIO"].ToString();
                        detail[6] = Sub_station_code;
                        complaints_center comp_cent = new complaints_center();
                        DataTable Center = comp_cent.get_complaints_center(detail[5]);
                        detail[7] = Center.Rows[0]["COMP_CEN_ID"].ToString();
                        reg.User_Web_comp_reg(reg, detail);
                        DataTable dt2 = reg.Get_complaint_NO(CA_NO);
                        ModelState.AddModelError("", "Your Complain is registered.Your Complain number is '" + dt2.Rows[0]["COMP_NO"].ToString() + "' ");

                    }
                }
            }
            catch
            {
                ModelState.AddModelError("", "There is some problem in complain registration,plz try later");
            }
            fault_type();
            User_comp_clear(reg);
            return View();
        }
Exemplo n.º 5
0
 public ActionResult user_complain_reg(user_complain_reg reg)
 {
     fault_type();
     return View(reg);
 }
Exemplo n.º 6
0
        public void User_Web_comp_reg(user_complain_reg user_complain, string[] detail)
        {
            try
            {
                Database db = DatabaseFactory.CreateDatabase();
                using (DbCommand dbcmd = db.GetSqlStringCommand(Query.User_Web_comp_reg(user_complain,detail)))
                {
                    db.ExecuteDataSet(dbcmd);

                }
            }
            catch (OleDbException e)
            {
                throw e;
            }
        }
Exemplo n.º 7
0
        public void User_Web_comp_reg(user_complain_reg user_complain, string[] detail)
        {
            try
            {

                User_Complain_reg reg = new User_Complain_reg();
                reg.User_Web_comp_reg(user_complain, detail);

            }
            catch (OleDbException e)
            {
                throw e;
            }
        }