添加具有相同客户名称的服务日期 [英] adding service dates with same customer name

查看:89
本文介绍了添加具有相同客户名称的服务日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI朋友,,,





我的要求是



1.在一年内,我们将根据他们支付的计划提供2次或3次或4次免费服务。这就像预防性维护。



如果客户在一年中选择3项服务,我将添加以下日期



姓名 服务日期



Sunil 5/2/2013



Sunil 5/5/2013



Sunil 2013年5月8日



单击按钮就会发生上述事情。我们将仅选择服务类型(2次,3次,4次)。





请给我一个解决方案。

HI Friends,,,


My requirement is

1. In a year we will give a free services for 2 times or 3 times or 4 times based on plan they have paid. It''s like a preventive maintenance.

If customer select 3 services in a year i will add the dates as below

Name Service Dates

Sunil 5/2/2013

Sunil 5/5/2013

Sunil 5/8/2013

The above thing will happen on a single button click. We will select only service types (2 times ,3 times ,4 times) .


Please give me a solution for this.

推荐答案

你好,



在我看来,你可以有一个按钮和一个下拉列表。

下拉列表的值可以是2次,3次,4次。

在下拉列表的selectedindex更改事件中,在SQL中有一个表格,它将获得所需的日期。

并点击按钮,我猜想在gridview中相应地显示供应商的名称和服务日期。



尝试以上方法。

希望它有所帮助。



问候

anurag
Hi,

In my opinion you can have a button and a dropdownlist.
The dropdownlist can have the values "2 times","3 times","4 times".
On the selectedindex changed event of the dropdownlist, have a table in SQL which will get the required dates.
And on the button click, display the name of the vendor and the service dates accordingly in a gridview I suppose.

Try the above.
Hope it helps.

regards
anurag


你有这样的事情

you have do something like this
int serNo=cmbSerPack.SelectedValue ;//get selected service types 
DateTime SerDate=Calendar1.SelectedDate;//Get date from ur date source

While(serNo > 0)
{
// your insert code here
DateTime answer = SerDate.AddDays(3);
serNo =serNo-1;
}


<body>
    <form id="form1" runat="server">
    <div>

        <table style="width:100%;">
            <tr>
                <td>
                    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                </td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                </td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
                </td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
        <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />

    </div>
    </form>
</body>










using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

public partial class Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        DataTable DT = new DataTable();
        DT.Columns.Add("CODE");
        if (TextBox1.Text != "")
        {
            DT.Rows.Add(TextBox1.Text);
        }
        if (TextBox2.Text != "")
        {
            DT.Rows.Add(TextBox2.Text);
        }
        if (TextBox3.Text != "")
        {
            DT.Rows.Add(TextBox3.Text);
        }
            int j = DT.Rows.Count;
            if (j > 0)
            {
                for (int i = 0; i < j; i++)
                {
                    Response.Write("X");// this is use for test
                    // insert code//
                }
            }
    }
}


这篇关于添加具有相同客户名称的服务日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆